logging_init("udev");
if (devnull < 0)
- err("open /dev/null failed: %s", strerror(errno));
+ err("open /dev/null failed: %s\n", strerror(errno));
udev_config_init();
selinux_init();
- dbg("version %s", UDEV_VERSION);
+ dbg("version %s\n", UDEV_VERSION);
/* set signal handlers */
memset(&act, 0x00, sizeof(act));
sigaction(SIGTERM, &act, NULL);
/* trigger timeout to prevent hanging processes */
- alarm(UDEV_ALARM_TIMEOUT);
+ alarm(UDEV_EVENT_TIMEOUT);
action = getenv("ACTION");
devpath = getenv("DEVPATH");
subsystem = argv[1];
if (action == NULL || subsystem == NULL || devpath == NULL) {
- err("action, subsystem or devpath missing");
+ err("action, subsystem or devpath missing\n");
goto exit;
}
dev = sysfs_device_get(devpath);
if (dev == NULL) {
- info("unable to open '%s'", devpath);
+ info("unable to open '%s'\n", devpath);
goto fail;
}
retval = udev_device_event(&rules, udev);
+ /* rules may change/disable the timeout */
+ if (udev->event_timeout >= 0)
+ alarm(udev->event_timeout);
+
if (retval == 0 && !udev->ignore_device && udev_run)
udev_rules_run(udev);