From 5c83e5f9d5f672817e64c7c8c0865d3a3e2eaf14 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 21 May 2008 13:06:46 -0700 Subject: Make 3.0.x in sync with 3.2 here. Jeremy. --- source/lib/xfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/lib/xfile.c b/source/lib/xfile.c index 9f8348333d5..1ecaaa00406 100644 --- a/source/lib/xfile.c +++ b/source/lib/xfile.c @@ -256,10 +256,10 @@ 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->bufused == 0 || !f->buf) return 0; + if ((f->open_flags & O_ACCMODE) != O_WRONLY) { errno = EINVAL; return -1; -- cgit v1.2.1