From 0b0d1fe1d4fbf8560577d81e5af0549683eac8ba Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sun, 16 Aug 2020 12:39:16 -0400 Subject: error for any write() < 0 --- src/stdio/fflush.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/stdio') 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; -- cgit v1.2.1