From b477e59dd3f3d70a7ce0efe28f94dc80e64cacc6 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 20 May 2007 22:01:15 +0200 Subject: inotail.c: Proper check of return value for the previous fix --- inotail.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inotail.c b/inotail.c index 79bad64..3384d5b 100644 --- a/inotail.c +++ b/inotail.c @@ -222,9 +222,9 @@ static ssize_t tail_pipe(struct file_struct *f) /* We will just tail everything here */ while ((rc = read(f->fd, buf, BUFFER_SIZE)) > 0) { - if (write(STDOUT_FILENO, buf, (size_t) rc)) { + if (write(STDOUT_FILENO, buf, (size_t) rc) < 0) { /* e.g. when writing to a pipe which gets closed */ - fprintf(stderr, "Error: Could not write to stdout: %s\n", strerror(errno)); + fprintf(stderr, "Error: Could not write to stdout (%s)\n", strerror(errno)); return -1; } } -- cgit v1.2.3-54-g00ecf