runsvd: shrink by Vladimir
*: use unified trivial signal handler function old new delta record_signo - 10 +10 process_stdin 433 443 +10 bbunpack 383 391 +8 wc_main 598 605 +7 conescape 293 296 +3 nmeter_main 670 672 +2 fallbackSort 1717 1719 +2 bb_got_signal - 1 +1 microcom_main 713 712 -1 signalled 2 - -2 pack_gzip 1661 1659 -2 evalvar 1376 1374 -2 compare_keys 737 735 -2 parse_command 1460 1456 -4 expand 1748 1744 -4 s_term 37 29 -8 s_hangup 8 - -8 fgotsig 10 - -10 find_pair 187 169 -18 signal_handler 190 170 -20 runsvdir_main 1701 1583 -118 ------------------------------------------------------------------------------ (add/remove: 2/3 grow/shrink: 6/10 up/down: 43/-199) Total: -156 bytes
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user