diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2007-05-20 22:01:15 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@xenon.tklauser.home> | 2007-05-20 22:01:15 +0200 |
commit | b477e59dd3f3d70a7ce0efe28f94dc80e64cacc6 (patch) | |
tree | 93abe9830f51d9d2bb07c2f121694754923b21b7 | |
parent | 97fc6ccc502804ca5f6bd4e069ed4b8a12cc1bac (diff) |
inotail.c: Proper check of return value for the previous fix
-rw-r--r-- | inotail.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } } |