summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
Diffstat (limited to 'udev')
-rw-r--r--udev/udev-rules.c5
-rw-r--r--udev/udevd.c2
2 files changed, 3 insertions, 4 deletions
diff --git a/udev/udev-rules.c b/udev/udev-rules.c
index c4a2724032..0361f689d5 100644
--- a/udev/udev-rules.c
+++ b/udev/udev-rules.c
@@ -2055,13 +2055,12 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
struct token *cur;
struct token *rule;
enum escape_type esc = ESCAPE_UNSET;
- int can_set_name;
+ bool can_set_name;
if (rules->tokens == NULL)
return -1;
- can_set_name = ((strcmp(udev_device_get_action(event->dev), "add") == 0 ||
- strcmp(udev_device_get_action(event->dev), "change") == 0) &&
+ can_set_name = ((strcmp(udev_device_get_action(event->dev), "remove") != 0) &&
(major(udev_device_get_devnum(event->dev)) > 0 ||
strcmp(udev_device_get_subsystem(event->dev), "net") == 0));
diff --git a/udev/udevd.c b/udev/udevd.c
index fe3352ceb5..c27b4cd6aa 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -168,7 +168,7 @@ static void event_queue_delete(struct event *event)
udev_list_node_remove(&event->node);
/* mark as failed, if "add" event returns non-zero */
- if (event->exitcode != 0 && strcmp(udev_device_get_action(event->dev), "add") == 0)
+ if (event->exitcode != 0 && strcmp(udev_device_get_action(event->dev), "remove") != 0)
udev_queue_export_device_failed(udev_queue_export, event->dev);
else
udev_queue_export_device_finished(udev_queue_export, event->dev);