aboutsummaryrefslogtreecommitdiff
path: root/miscutils/inotifyd.c
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils/inotifyd.c')
-rw-r--r--miscutils/inotifyd.c11
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 @@
#include "libbb.h"
#include <linux/inotify.h>
-static volatile smallint signalled;
-
-static void signal_handler(int signo)
-{
- signalled = signo;
-}
-
static const char mask_names[] ALIGN1 =
"a" // 0x00000001 File was accessed
"c" // 0x00000002 File was modified
@@ -104,14 +97,14 @@ int inotifyd_main(int argc UNUSED_PARAM, char **argv)
+ (1 << SIGINT)
+ (1 << SIGTERM)
+ (1 << SIGPIPE)
- , signal_handler);
+ , record_signo);
// do watch
// pfd.fd = fd;
pfd.events = POLLIN;
- while (!signalled && poll(&pfd, 1, -1) > 0) {
+ while (!bb_got_signal && poll(&pfd, 1, -1) > 0) {
ssize_t len;
void *buf;
struct inotify_event *ie;