diff options
author | Jeremy Allison <jra@samba.org> | 2008-05-21 13:02:40 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2008-05-21 13:02:40 -0700 |
commit | 9c5c3eadf5aaf9821c0ebe1d2bb533eff22aab63 (patch) | |
tree | 550d5e31eb4f3b4441dfd467bc120f9420893f35 | |
parent | d1223dd331841c2482301a9418e3a8607c81a8e9 (diff) | |
download | samba-9c5c3eadf5aaf9821c0ebe1d2bb533eff22aab63.tar.gz |
Don't error out on xflush if there's no buffer.
Jeremy.
-rw-r--r-- | source/lib/xfile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/lib/xfile.c b/source/lib/xfile.c index d5b1731430a..9f8348333d5 100644 --- a/source/lib/xfile.c +++ b/source/lib/xfile.c @@ -256,6 +256,8 @@ int x_fflush(XFILE *f) { int ret; + if (f->bufused == 0 || !f->buf) return 0; + if (f->flags & X_FLAG_ERROR) return -1; if ((f->open_flags & O_ACCMODE) != O_WRONLY) { @@ -263,8 +265,6 @@ int x_fflush(XFILE *f) return -1; } - if (f->bufused == 0 || !f->buf) return 0; - ret = write(f->fd, f->buf, f->bufused); if (ret == -1) return -1; |