# ------------------------------------------------------------------------------
# libudev
# ------------------------------------------------------------------------------
-LIBUDEV_CURRENT=5
-LIBUDEV_REVISION=2
-LIBUDEV_AGE=5
+LIBUDEV_CURRENT=6
+LIBUDEV_REVISION=0
+LIBUDEV_AGE=6
SUBDIRS += libudev/docs
const char *format, ...)
__attribute__((format(printf, 6, 7)));
const char *udev_get_rules_path(struct udev *udev);
-int udev_get_run(struct udev *udev);
struct udev_list_entry *udev_add_property(struct udev *udev, const char *key, const char *value);
struct udev_list_entry *udev_get_properties_list_entry(struct udev *udev);
char *rules_path;
struct udev_list_node properties_list;
int log_priority;
- int run;
};
void udev_log(struct udev *udev,
udev->log_fn = log_stderr;
udev->log_priority = LOG_ERR;
udev_list_init(&udev->properties_list);
- udev->run = 1;
udev->dev_path = strdup("/dev");
udev->sys_path = strdup("/sys");
config_file = strdup(SYSCONFDIR "/udev/udev.conf");
udev_add_property(udev, "SYSFS_PATH", udev->sys_path);
}
- env = getenv("UDEV_RUN");
- if (env != NULL && strcmp(env, "0") == 0)
- udev->run = 0;
-
env = getenv("UDEV_CONFIG_FILE");
if (env != NULL) {
free(config_file);
return udev->rules_path;
}
-int udev_get_run(struct udev *udev)
-{
- return udev->run;
-}
-
/**
* udev_get_sys_path:
* @udev: udev library context
if (udev_device_get_event_timeout(dev) >= 0)
alarm(udev_device_get_event_timeout(dev));
- if (err == 0 && udev_get_run(udev))
+ if (err == 0)
udev_event_execute_run(event, NULL);
udev_event_unref(event);
udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev))
info(udev, "%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
- if (err == 0 && udev_get_run(udev)) {
+ if (err == 0)
udev_list_entry_foreach(entry, udev_list_get_entry(&event->run_list)) {
char program[UTIL_PATH_SIZE];
udev_event_apply_format(event, udev_list_entry_get_name(entry), program, sizeof(program));
info(udev, "run: '%s'\n", program);
}
- }
udev_event_unref(event);
udev_device_unref(dev);
exit:
if (udev_device_get_event_timeout(dev) >= 0)
alarm(udev_device_get_event_timeout(dev));
- /* execute RUN= */
- if (err == 0 && udev_get_run(udev_event->udev))
- failed = udev_event_execute_run(udev_event,
- &orig_sigmask);
+ if (err == 0)
+ failed = udev_event_execute_run(udev_event, &orig_sigmask);
- /* reset alarm */
alarm(0);
/* apply/restore inotify watch */
/* send processed event back to libudev listeners */
udev_monitor_send_device(worker_monitor, NULL, dev);
- /* send back the result of the event execution */
+ /* send udevd the result of the event execution */
if (err != 0)
msg.exitcode = err;
else if (failed != 0)