From ec2c7cba0e2a9f3f4c15119525fa16d1a359a6b2 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 31 Aug 2008 21:34:16 +0200 Subject: Check for file being a pipe before seeking Otherwise inotail -f on a named pipe (fifo) would not work. Thanks Alexander Sulfrian. --- inotail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inotail.c') diff --git a/inotail.c b/inotail.c index d708f1f..62920ba 100644 --- a/inotail.c +++ b/inotail.c @@ -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; } -- cgit v1.2.3-54-g00ecf