git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d1223dd
)
Don't error out on xflush if there's no buffer.
author
Jeremy Allison
<jra@samba.org>
Wed, 21 May 2008 20:02:40 +0000
(13:02 -0700)
committer
Jeremy Allison
<jra@samba.org>
Wed, 21 May 2008 20:02:40 +0000
(13:02 -0700)
Jeremy.
source/lib/xfile.c
patch
|
blob
|
history
diff --git
a/source/lib/xfile.c
b/source/lib/xfile.c
index d5b1731430a76fd63764ce515e0e2701f4d8c022..9f8348333d5340f503474efe36f1e40c1adacd6f 100644
(file)
--- 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;