diff options
Diffstat (limited to 'miscutils/inotifyd.c')
-rw-r--r-- | miscutils/inotifyd.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/miscutils/inotifyd.c b/miscutils/inotifyd.c index 2a1a15348..3b11dc271 100644 --- a/miscutils/inotifyd.c +++ b/miscutils/inotifyd.c | |||
@@ -30,13 +30,6 @@ | |||
30 | #include "libbb.h" | 30 | #include "libbb.h" |
31 | #include <linux/inotify.h> | 31 | #include <linux/inotify.h> |
32 | 32 | ||
33 | static volatile smallint signalled; | ||
34 | |||
35 | static void signal_handler(int signo) | ||
36 | { | ||
37 | signalled = signo; | ||
38 | } | ||
39 | |||
40 | static const char mask_names[] ALIGN1 = | 33 | static const char mask_names[] ALIGN1 = |
41 | "a" // 0x00000001 File was accessed | 34 | "a" // 0x00000001 File was accessed |
42 | "c" // 0x00000002 File was modified | 35 | "c" // 0x00000002 File was modified |
@@ -104,14 +97,14 @@ int inotifyd_main(int argc UNUSED_PARAM, char **argv) | |||
104 | + (1 << SIGINT) | 97 | + (1 << SIGINT) |
105 | + (1 << SIGTERM) | 98 | + (1 << SIGTERM) |
106 | + (1 << SIGPIPE) | 99 | + (1 << SIGPIPE) |
107 | , signal_handler); | 100 | , record_signo); |
108 | 101 | ||
109 | // do watch | 102 | // do watch |
110 | 103 | ||
111 | // pfd.fd = fd; | 104 | // pfd.fd = fd; |
112 | pfd.events = POLLIN; | 105 | pfd.events = POLLIN; |
113 | 106 | ||
114 | while (!signalled && poll(&pfd, 1, -1) > 0) { | 107 | while (!bb_got_signal && poll(&pfd, 1, -1) > 0) { |
115 | ssize_t len; | 108 | ssize_t len; |
116 | void *buf; | 109 | void *buf; |
117 | struct inotify_event *ie; | 110 | struct inotify_event *ie; |