chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Docs: udev.xml: Clarify through a change in word ordering
[elogind.git]
/
udev
/
test-udev.c
diff --git
a/udev/test-udev.c
b/udev/test-udev.c
index 6ec91c174a20202f86d8471c04f18bbf06b139fd..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);
@@
-83,8
+89,7
@@
int main(int argc, char *argv[])
rules = udev_rules_new(udev, 1);
rules = udev_rules_new(udev, 1);
- util_strlcpy(syspath, udev_get_sys_path(udev), sizeof(syspath));
- util_strlcat(syspath, devpath, sizeof(syspath));
+ util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL);
dev = udev_device_new_from_syspath(udev, syspath);
if (dev == NULL) {
info(udev, "unknown device '%s'\n", devpath);
dev = udev_device_new_from_syspath(udev, syspath);
if (dev == NULL) {
info(udev, "unknown device '%s'\n", devpath);
@@
-103,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);