[SCM] Samba Shared Repository - branch v3-0-test updated - release-3-0-28a-24-gf1cff02

Jeremy Allison jra at samba.org
Tue Apr 8 22:10:42 GMT 2008


The branch, v3-0-test has been updated
       via  f1cff02beef84a1d35d7786f143959807d3de28a (commit)
      from  1261d7f713fedb312dfcfdd58c7d5b45e8185ba7 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-0-test


- Log -----------------------------------------------------------------
commit f1cff02beef84a1d35d7786f143959807d3de28a
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Apr 8 15:10:07 2008 -0700

    Check x_fflush returns.
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source/lib/xfile.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/xfile.c b/source/lib/xfile.c
index 8824ca2..d5b1731 100644
--- a/source/lib/xfile.c
+++ b/source/lib/xfile.c
@@ -48,7 +48,7 @@ XFILE *x_stderr = &_x_stderr;
 /* simulate setvbuf() */
 int x_setvbuf(XFILE *f, char *buf, int mode, size_t size)
 {
-	x_fflush(f);
+	if (x_fflush(f) != 0) return -1;
 	if (f->bufused) return -1;
 
 	/* on files being read full buffering is the only option */
@@ -151,7 +151,7 @@ int x_fclose(XFILE *f)
 	int ret;
 
 	/* make sure we flush any buffered data */
-	x_fflush(f);
+	(void)x_fflush(f);
 
 	ret = close(f->fd);
 	f->fd = -1;
@@ -190,7 +190,9 @@ size_t x_fwrite(const void *p, size_t size, size_t nmemb, XFILE *f)
 
 		if (n == 0) {
 			/* it's full, flush it */
-			x_fflush(f);
+			if (x_fflush(f) != 0) {
+				return -1;
+			}
 			continue;
 		}
 
@@ -205,7 +207,9 @@ size_t x_fwrite(const void *p, size_t size, size_t nmemb, XFILE *f)
 		int i;
 		for (i=(size*nmemb)-1; i>=0; i--) {
 			if (*(i+(const char *)p) == '\n') {
-				x_fflush(f);
+				if (x_fflush(f) != 0) {
+					return -1;
+				}
 				break;
 			}
 		}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list