diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2008-08-31 21:34:16 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@xenon.tklauser.home> | 2008-08-31 21:34:16 +0200 |
commit | ec2c7cba0e2a9f3f4c15119525fa16d1a359a6b2 (patch) | |
tree | 656503671dca083c3f695167465065c2b886ac9c | |
parent | 164d300c2d4d88f2bd787a0c56dc34b3ebb47073 (diff) |
Check for file being a pipe before seeking
Otherwise inotail -f on a named pipe (fifo) would not work. Thanks Alexander
Sulfrian.
-rw-r--r-- | inotail.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -591,7 +591,7 @@ static int handle_inotify_event(struct inotify_event *inev, struct file_struct * } /* Seek to old file size */ - if ((ret = lseek(f->fd, f->size, SEEK_SET)) == (off_t) -1) { + if (!IS_PIPELIKE(finfo.st_mode) && (ret = lseek(f->fd, f->size, SEEK_SET)) == (off_t) -1) { fprintf(stderr, "Error: Could not seek in file '%s' (%s)\n", f->name, strerror(errno)); goto ignore; } |