diff options
author | Jakob Kaivo <jkk@ung.org> | 2020-08-16 12:39:16 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2020-08-16 12:39:16 -0400 |
commit | 0b0d1fe1d4fbf8560577d81e5af0549683eac8ba (patch) | |
tree | 03b7b18bb490ec5a75c629422425be001e39cf05 | |
parent | 7848df8f2a5bc3b95e2b05b8876708bb93230de7 (diff) |
error for any write() < 0
-rw-r--r-- | src/stdio/fflush.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/fflush.c b/src/stdio/fflush.c index a61f5323..19096714 100644 --- a/src/stdio/fflush.c +++ b/src/stdio/fflush.c @@ -24,7 +24,7 @@ int fflush(FILE *stream) } flockfile(stream); - if (write(stream->fd, stream->buf, stream->bpos) == -1) { + if (write(stream->fd, stream->buf, stream->bpos) < 0) { /* errno is set */ ret = EOF; stream->err = 1; |