summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inotail.c3
-rw-r--r--inotail.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/inotail.c b/inotail.c
index c0c5302..da881d4 100644
--- a/inotail.c
+++ b/inotail.c
@@ -245,8 +245,7 @@ static int watch_files(struct file_struct *f, int n_files)
}
}
- /* Very unlikely! */
- if (!fil)
+ if (unlikely(!fil))
break;
if (inev->mask & IN_MODIFY) {
diff --git a/inotail.h b/inotail.h
index d885855..f6e90e8 100644
--- a/inotail.h
+++ b/inotail.h
@@ -24,4 +24,7 @@ struct file_struct {
# define dprintf(fmt, args...)
#endif /* DEBUG */
+/* Taken from linux kernel source tree */
+#define unlikely(x) __builtin_expect(!!(x), 0)
+
#endif /* _INOTAIL_H */