diff options
-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 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; |