From 07e0094365e8dc360a83eec2e7cf9b1d5d8d6d00 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 31 Dec 2008 18:06:57 -0800 Subject: Fix all warnings in source3 with gcc4.3. Jeremy. --- source3/client/clitar.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 7ad8a73e9ca..18edf037e26 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -329,13 +329,13 @@ static int dotarbuf(int f, char *b, int n) diff=tbufsiz-tp; memcpy(tarbuf + tp, b, diff); - fail=fail && (1+write(f, tarbuf, tbufsiz)); + fail=fail && (1+sys_write(f, tarbuf, tbufsiz)); n-=diff; b+=diff; tp=0; while (n >= tbufsiz) { - fail=fail && (1 + write(f, b, tbufsiz)); + fail=fail && (1 + sys_write(f, b, tbufsiz)); n-=tbufsiz; b+=tbufsiz; } @@ -364,7 +364,10 @@ static void dozerobuf(int f, int n) if (n+tp >= tbufsiz) { memset(tarbuf+tp, 0, tbufsiz-tp); - write(f, tarbuf, tbufsiz); + if (sys_write(f, tarbuf, tbufsiz) != tbufsiz) { + DEBUG(0, ("dozerobuf: sys_write fail\n")); + return; + } memset(tarbuf, 0, (tp+=n-tbufsiz)); } else { memset(tarbuf+tp, 0, n); @@ -408,8 +411,12 @@ static void dotareof(int f) /* Could be a pipe, in which case S_ISREG should fail, * and we should write out at full size */ - if (tp > 0) - write(f, tarbuf, S_ISREG(stbuf.st_mode) ? tp : tbufsiz); + if (tp > 0) { + size_t towrite = S_ISREG(stbuf.st_mode) ? tp : tbufsiz; + if (sys_write(f, tarbuf, towrite) != towrite) { + DEBUG(0,("dotareof: sys_write fail\n")); + } + } } /**************************************************************************** -- cgit