chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
keymap: Explain how to end the program
[elogind.git]
/
udev
/
test-udev.c
diff --git
a/udev/test-udev.c
b/udev/test-udev.c
index c6b8bf573ba774b7d7464906cff1a42f1935fca3..28c833a9e5201856173f81a1ef115ca522393584 100644
(file)
--- a/
udev/test-udev.c
+++ b/
udev/test-udev.c
@@
-52,6
+52,7
@@
int main(int argc, char *argv[])
const char *action;
const char *subsystem;
struct sigaction act;
const char *action;
const char *subsystem;
struct sigaction act;
+ sigset_t mask;
int err = -EINVAL;
udev = udev_new();
int err = -EINVAL;
udev = udev_new();
@@
-68,6
+69,11
@@
int main(int argc, char *argv[])
sigaction(SIGALRM, &act, NULL);
sigaction(SIGINT, &act, NULL);
sigaction(SIGTERM, &act, NULL);
sigaction(SIGALRM, &act, NULL);
sigaction(SIGINT, &act, NULL);
sigaction(SIGTERM, &act, NULL);
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGALRM);
+ sigaddset(&mask, SIGINT);
+ sigaddset(&mask, SIGTERM);
+ sigprocmask(SIG_UNBLOCK, &mask, NULL);
/* trigger timeout to prevent hanging processes */
alarm(UDEV_EVENT_TIMEOUT);
/* trigger timeout to prevent hanging processes */
alarm(UDEV_EVENT_TIMEOUT);
@@
-102,8
+108,8
@@
int main(int argc, char *argv[])
if (udev_device_get_event_timeout(dev) >= 0)
alarm(udev_device_get_event_timeout(dev));
if (udev_device_get_event_timeout(dev) >= 0)
alarm(udev_device_get_event_timeout(dev));
- if (err == 0
&& !event->ignore_device && udev_get_run(udev)
)
- udev_event_execute_run(event);
+ if (err == 0)
+ udev_event_execute_run(event
, NULL
);
udev_event_unref(event);
udev_device_unref(dev);
udev_event_unref(event);
udev_device_unref(dev);