From 517469b48f49edc4d4230e3ae1648d7306d72a62 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 8 Dec 2006 19:39:14 +0100 Subject: inotail.c: Merge S_ISFIFO and S_ISSOCK to IS_PIPELIKE --- inotail.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'inotail.c') diff --git a/inotail.c b/inotail.c index 7b58477..f16b23b 100644 --- a/inotail.c +++ b/inotail.c @@ -41,9 +41,12 @@ #define PROGRAM_NAME "inotail" #define BUFFER_SIZE 4096 +#define IS_PIPELIKE(mode) \ + (S_ISFIFO(mode) || S_ISSOCK(mode)) + /* (ino)tail works on these file types */ #define IS_TAILABLE(mode) \ - (S_ISREG(mode) || S_ISFIFO(mode) || S_ISSOCK(mode) || S_ISCHR(mode)) + (S_ISREG(mode) || IS_PIPELIKE(mode) || S_ISCHR(mode)) /* Print header with filename before tailing the file? */ static char verbose = 0; @@ -436,7 +439,7 @@ int main(int argc, char **argv) if (forever) { struct stat finfo; if (fstat(STDIN_FILENO, &finfo) == 0 - && (S_ISFIFO(finfo.st_mode) || S_ISSOCK(finfo.st_mode))) + && IS_PIPELIKE(finfo.st_mode)) forever = 0; } } -- cgit v1.2.3-54-g00ecf