diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2007-06-02 16:06:20 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@xenon.tklauser.home> | 2007-06-02 16:06:20 +0200 |
commit | 8da82b981b2c73c8e353f2d8054581d304adc3bf (patch) | |
tree | 1f24c2e6dadad54f687802bf560d533eea61fba0 | |
parent | 701639c00d851f7f829ab6559e2fbd1d229ee298 (diff) |
inotail.c: Correct error condition in tail_pipe()
write() returns 0 on end of file
-rw-r--r-- | inotail.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |