chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
core: allow informing systemd about service status changes with RELOADING=1 and STOPP...
[elogind.git]
/
src
/
test
/
test-udev.c
diff --git
a/src/test/test-udev.c
b/src/test/test-udev.c
index 17825f12b4031cf5c1e0195c369916b7ad4fa1fd..566a73a066f5d2452df19b5a08eea3af81203506 100644
(file)
--- a/
src/test/test-udev.c
+++ b/
src/test/test-udev.c
@@
-26,7
+26,6
@@
#include <ctype.h>
#include <errno.h>
#include <unistd.h>
#include <ctype.h>
#include <errno.h>
#include <unistd.h>
-#include <syslog.h>
#include <grp.h>
#include <sched.h>
#include <sys/mount.h>
#include <grp.h>
#include <sched.h>
#include <sys/mount.h>
@@
-80,9
+79,7
@@
out:
return err;
}
return err;
}
-
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
_cleanup_udev_unref_ struct udev *udev = NULL;
_cleanup_udev_event_unref_ struct udev_event *event = NULL;
_cleanup_udev_device_unref_ struct udev_device *dev = NULL;
_cleanup_udev_unref_ struct udev *udev = NULL;
_cleanup_udev_event_unref_ struct udev_event *event = NULL;
_cleanup_udev_device_unref_ struct udev_device *dev = NULL;
@@
-101,20
+98,20
@@
int main(int argc, char *argv[])
if (udev == NULL)
return EXIT_FAILURE;
if (udev == NULL)
return EXIT_FAILURE;
- log_debug("version %s
\n
", VERSION);
+ log_debug("version %s", VERSION);
label_init("/dev");
sigprocmask(SIG_SETMASK, NULL, &sigmask_orig);
action = argv[1];
if (action == NULL) {
label_init("/dev");
sigprocmask(SIG_SETMASK, NULL, &sigmask_orig);
action = argv[1];
if (action == NULL) {
- log_error("action missing
\n
");
+ log_error("action missing");
goto out;
}
devpath = argv[2];
if (devpath == NULL) {
goto out;
}
devpath = argv[2];
if (devpath == NULL) {
- log_error("devpath missing
\n
");
+ log_error("devpath missing");
goto out;
}
goto out;
}
@@
-123,7
+120,7
@@
int main(int argc, char *argv[])
strscpyl(syspath, sizeof(syspath), "/sys", devpath, NULL);
dev = udev_device_new_from_syspath(udev, syspath);
if (dev == NULL) {
strscpyl(syspath, sizeof(syspath), "/sys", devpath, NULL);
dev = udev_device_new_from_syspath(udev, syspath);
if (dev == NULL) {
- log_debug("unknown device '%s'
\n
", devpath);
+ log_debug("unknown device '%s'", devpath);
goto out;
}
goto out;
}
@@
-156,9
+153,8
@@
int main(int argc, char *argv[])
}
}
}
}
- err = udev_event_execute_rules(event, rules, &sigmask_orig);
- if (err == 0)
- udev_event_execute_run(event, NULL);
+ udev_event_execute_rules(event, USEC_PER_SEC, rules, &sigmask_orig);
+ udev_event_execute_run(event, USEC_PER_SEC, NULL);
out:
if (event != NULL && event->fd_signal >= 0)
close(event->fd_signal);
out:
if (event != NULL && event->fd_signal >= 0)
close(event->fd_signal);