summaryrefslogtreecommitdiff
path: root/udev/udev-event.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-12-28 01:49:01 +0100
committerKay Sievers <kay.sievers@vrfy.org>2008-12-28 01:49:01 +0100
commit1028fe14b65d861415cda99c4ff7d0bafd67bb7f (patch)
treeeebedb3fbbb15966c9690a7e0c19fe55179fe5ed /udev/udev-event.c
parent49bb7a8a2a942db5b763e5375295f81debc31ff5 (diff)
if needed, store database entries also for devices which do not have a device node
Diffstat (limited to 'udev/udev-event.c')
-rw-r--r--udev/udev-event.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/udev/udev-event.c b/udev/udev-event.c
index bc692392d2..93a65e7352 100644
--- a/udev/udev-event.c
+++ b/udev/udev-event.c
@@ -611,6 +611,7 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules)
/* add netif */
if (strcmp(udev_device_get_subsystem(dev), "net") == 0 && strcmp(udev_device_get_action(dev), "add") == 0) {
dbg(event->udev, "netif add '%s'\n", udev_device_get_devpath(dev));
+ udev_device_delete_db(dev);
udev_rules_apply_to_event(rules, event);
if (event->ignore_device) {
@@ -644,6 +645,7 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules)
info(event->udev, "changed devpath to '%s'\n", udev_device_get_devpath(dev));
}
}
+ udev_device_update_db(dev);
goto exit;
}
@@ -684,6 +686,11 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules)
udev_rules_apply_to_event(rules, event);
if (event->ignore_device)
info(event->udev, "device event will be ignored\n");
+
+ if (strcmp(udev_device_get_action(dev), "remove") != 0)
+ udev_device_update_db(dev);
+ else
+ udev_device_delete_db(dev);
exit:
return err;
}