diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2010-04-12 16:52:41 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2010-04-12 16:52:41 +0200 |
commit | 4b06c409350d26af5e6ace0f368d01b80d75438e (patch) | |
tree | 10d8291f4e1faf0c008e41c8570297490d45a09d /udev | |
parent | 86dc9133f88e8690aa89ccb5a240ff915b1fb69f (diff) |
replace "add|change" with "!remove"
Diffstat (limited to 'udev')
-rw-r--r-- | udev/udev-rules.c | 5 | ||||
-rw-r--r-- | udev/udevd.c | 2 |
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); |