summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2006-12-08 19:39:14 +0100
committerTobias Klauser <tklauser@xenon.tklauser.home>2006-12-08 19:39:14 +0100
commit517469b48f49edc4d4230e3ae1648d7306d72a62 (patch)
treed5c56dca96f6dc91461f738997e21a5a34b6e73a
parent72ecc9072d99510f9bd08b07de4aac51fe253e68 (diff)
inotail.c: Merge S_ISFIFO and S_ISSOCK to IS_PIPELIKE
-rw-r--r--inotail.c7
1 files changed, 5 insertions, 2 deletions
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;
}
}