diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2014-11-16 08:44:52 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-11-16 08:44:52 -0500 |
commit | d3ef837153dc1523d30cb160abfc35ab189d26fa (patch) | |
tree | 8e549358d9b182abd9c4b48e17fd1fed9b575fed /src | |
parent | 5fe138cdda4eb51036062b4bddce258fe97e7b68 (diff) |
src/udev: update the definition of udev_event_execute_rule
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/libudev/libudev-hwdb.c | 1 | ||||
-rw-r--r-- | src/udev/udev-event.c | 17 | ||||
-rw-r--r-- | src/udev/udev-rules.c | 1 | ||||
-rw-r--r-- | src/udev/udev.h | 11 | ||||
-rw-r--r-- | src/udev/udevadm-test.c | 6 | ||||
-rw-r--r-- | src/udev/udevd.c | 12 |
6 files changed, 36 insertions, 12 deletions
diff --git a/src/libudev/libudev-hwdb.c b/src/libudev/libudev-hwdb.c index 5eecd56f80..3773f8f868 100644 --- a/src/libudev/libudev-hwdb.c +++ b/src/libudev/libudev-hwdb.c @@ -360,6 +360,7 @@ bool udev_hwdb_validate(struct udev_hwdb *hwdb) { return false; if (stat("/etc/udev/hwdb.bin", &st) < 0) return true; + if (timespec_load(&hwdb->st.st_mtim) != timespec_load(&st.st_mtim)) return true; return false; diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index 317a593f2b..fc4a2ec848 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -847,9 +847,10 @@ static int rename_netif(struct udev_event *event) { } void udev_event_execute_rules(struct udev_event *event, - usec_t timeout_usec, - usec_t timeout_warn_usec, - struct udev_rules *rules, const sigset_t *sigmask) { + usec_t timeout_usec, usec_t timeout_warn_usec, + struct udev_list *properties_list, + struct udev_rules *rules, + const sigset_t *sigmask) { struct udev_device *dev = event->dev; if (udev_device_get_subsystem(dev) == NULL) @@ -863,7 +864,10 @@ void udev_event_execute_rules(struct udev_event *event, if (major(udev_device_get_devnum(dev)) != 0) udev_watch_end(event->udev, dev); - udev_rules_apply_to_event(rules, event,timeout_usec, timeout_warn_usec, sigmask); + udev_rules_apply_to_event(rules, event, + timeout_usec, timeout_warn_usec, + properties_list, + sigmask); if (major(udev_device_get_devnum(dev)) != 0) udev_node_remove(dev); @@ -897,7 +901,10 @@ void udev_event_execute_rules(struct udev_event *event, } } - udev_rules_apply_to_event(rules, event, timeout_usec, timeout_warn_usec, sigmask); + udev_rules_apply_to_event(rules, event, + timeout_usec, timeout_warn_usec, + properties_list, + sigmask); /* rename a new network interface, if needed */ diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index 40707ff731..be33777fe9 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -1945,6 +1945,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event, usec_t timeout_usec, usec_t timeout_warn_usec, + struct udev_list *properties_list, const sigset_t *sigmask) { struct token *cur; struct token *rule; diff --git a/src/udev/udev.h b/src/udev/udev.h index 86f4b98911..fae0408672 100644 --- a/src/udev/udev.h +++ b/src/udev/udev.h @@ -71,7 +71,9 @@ struct udev_rules; struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names); struct udev_rules *udev_rules_unref(struct udev_rules *rules); bool udev_rules_check_timestamp(struct udev_rules *rules); -int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event, usec_t timeout_usec, usec_t timeout_warn_usec, +int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event, + usec_t timeout_usec, usec_t timeout_warn_usec, + struct udev_list *properties_list, const sigset_t *sigmask); int udev_rules_apply_static_dev_perms(struct udev_rules *rules); @@ -86,8 +88,11 @@ int udev_event_spawn(struct udev_event *event, usec_t timeout_warn_usec, const char *cmd, char **envp, const sigset_t *sigmask, char *result, size_t ressize); -void udev_event_execute_rules(struct udev_event *event, usec_t timeout_usec, usec_t timeout_warn_usec, - struct udev_rules *rules, const sigset_t *sigset); +void udev_event_execute_rules(struct udev_event *event, + usec_t timeout_usec, usec_t timeout_warn_usec, + struct udev_list *properties_list, + struct udev_rules *rules, + const sigset_t *sigset); void udev_event_execute_run(struct udev_event *event, usec_t timeout_usec, usec_t timeout_warn_usec, const sigset_t *sigset); int udev_build_argv(struct udev *udev, char *cmd, int *argc, char *argv[]); diff --git a/src/udev/udevadm-test.c b/src/udev/udevadm-test.c index 4738b611c3..d9d61b42d5 100644 --- a/src/udev/udevadm-test.c +++ b/src/udev/udevadm-test.c @@ -136,7 +136,11 @@ static int adm_test(struct udev *udev, int argc, char *argv[]) { goto out; } - udev_event_execute_rules(event, 60 * USEC_PER_SEC, 20 * USEC_PER_SEC, rules, &sigmask_orig); + udev_event_execute_rules(event, + 60 * USEC_PER_SEC, 20 * USEC_PER_SEC, + NULL, + rules, + &sigmask_orig); udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev)) printf("%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry)); diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 510712a1b9..f5e116623e 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -300,9 +300,15 @@ static void worker_new(struct event *event) { } /* apply rules, create node, symlinks */ - udev_event_execute_rules(udev_event, arg_event_timeout_usec, arg_event_timeout_warn_usec, rules, &sigmask_orig); - - udev_event_execute_run(udev_event, arg_event_timeout_usec, arg_event_timeout_warn_usec, &sigmask_orig); + udev_event_execute_rules(udev_event, + arg_event_timeout_usec, arg_event_timeout_warn_usec, + &properties_list, + rules, + &sigmask_orig); + + udev_event_execute_run(udev_event, + arg_event_timeout_usec, arg_event_timeout_warn_usec, + &sigmask_orig); /* apply/restore inotify watch */ if (udev_event->inotify_watch) { |