From 8da82b981b2c73c8e353f2d8054581d304adc3bf Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sat, 2 Jun 2007 16:06:20 +0200 Subject: inotail.c: Correct error condition in tail_pipe() write() returns 0 on end of file --- inotail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inotail.c b/inotail.c index e0ed410..3a4bc1a 100644 --- a/inotail.c +++ b/inotail.c @@ -222,7 +222,7 @@ 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) < 0) { + 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)); return -1; -- cgit v1.2.3-54-g00ecf