diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2006-12-08 19:39:14 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@xenon.tklauser.home> | 2006-12-08 19:39:14 +0100 |
commit | 517469b48f49edc4d4230e3ae1648d7306d72a62 (patch) | |
tree | d5c56dca96f6dc91461f738997e21a5a34b6e73a | |
parent | 72ecc9072d99510f9bd08b07de4aac51fe253e68 (diff) |
inotail.c: Merge S_ISFIFO and S_ISSOCK to IS_PIPELIKE
-rw-r--r-- | inotail.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; } } |