summaryrefslogtreecommitdiffstats
path: root/xlators/features/changelog/lib/src/gf-changelog-helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/changelog/lib/src/gf-changelog-helpers.c')
-rw-r--r--xlators/features/changelog/lib/src/gf-changelog-helpers.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/xlators/features/changelog/lib/src/gf-changelog-helpers.c b/xlators/features/changelog/lib/src/gf-changelog-helpers.c
index d6245743437..8b35f4e9416 100644
--- a/xlators/features/changelog/lib/src/gf-changelog-helpers.c
+++ b/xlators/features/changelog/lib/src/gf-changelog-helpers.c
@@ -11,10 +11,11 @@
#include "changelog-mem-types.h"
#include "gf-changelog-helpers.h"
#include "changelog-lib-messages.h"
+#include "syscall.h"
ssize_t gf_changelog_read_path (int fd, char *buffer, size_t bufsize)
{
- return read (fd, buffer, bufsize);
+ return sys_read (fd, buffer, bufsize);
}
size_t
@@ -24,8 +25,7 @@ gf_changelog_write (int fd, char *buffer, size_t len)
size_t written = 0;
while (written < len) {
- size = write (fd,
- buffer + written, len - written);
+ size = sys_write (fd, buffer + written, len - written);
if (size <= 0)
break;
@@ -81,7 +81,9 @@ static ssize_t
my_read (read_line_t *tsd, int fd, char *ptr)
{
if (tsd->rl_cnt <= 0) {
- if ( (tsd->rl_cnt = read (fd, tsd->rl_buf, MAXLINE)) < 0 )
+ tsd->rl_cnt = sys_read (fd, tsd->rl_buf, MAXLINE);
+
+ if (tsd->rl_cnt < 0)
return -1;
else if (tsd->rl_cnt == 0)
return 0;
@@ -154,7 +156,8 @@ gf_lseek (int fd, off_t offset, int whence)
if (gf_readline_init_once (&tsd))
return -1;
- if ( (off = lseek (fd, offset, whence)) == -1)
+ off = sys_lseek (fd, offset, whence);
+ if (off == -1)
return -1;
tsd->rl_cnt = 0;
@@ -171,7 +174,7 @@ gf_ftruncate (int fd, off_t length)
if (gf_readline_init_once (&tsd))
return -1;
- if (ftruncate (fd, 0))
+ if (sys_ftruncate (fd, 0))
return -1;
tsd->rl_cnt = 0;