replace "add|change" with "!remove"
authorKay Sievers <kay.sievers@vrfy.org>
Mon, 12 Apr 2010 14:52:41 +0000 (16:52 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Mon, 12 Apr 2010 14:52:41 +0000 (16:52 +0200)
19 files changed:
extras/cdrom_id/60-cdrom_id.rules
extras/edd_id/61-persistent-storage-edd.rules
extras/fstab_import/79-fstab_import.rules
extras/hid2hci/70-hid2hci.rules
extras/keymap/95-keyboard-force-release.rules
extras/keymap/95-keymap.rules
extras/udev-acl/70-acl.rules
extras/udev-acl/udev-acl.c
extras/v4l_id/60-persistent-v4l.rules
rules/rules.d/60-persistent-alsa.rules
rules/rules.d/60-persistent-input.rules
rules/rules.d/60-persistent-serial.rules
rules/rules.d/60-persistent-storage-tape.rules
rules/rules.d/60-persistent-storage.rules
rules/rules.d/75-net-description.rules
rules/rules.d/75-tty-description.rules
rules/suse/64-device-mapper.rules
udev/udev-rules.c
udev/udevd.c

index 811c4aa..16b3af9 100644 (file)
@@ -1,6 +1,6 @@
 # do not edit this file, it will be overwritten on update
 
-ACTION!="add|change", GOTO="cdrom_end"
+ACTION=="remove", GOTO="cdrom_end"
 SUBSYSTEM!="block", GOTO="cdrom_end"
 KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end"
 ENV{DEVTYPE}!="disk", GOTO="cdrom_end"
index 54ae086..1ab1be3 100644 (file)
@@ -1,6 +1,6 @@
 # do not edit this file, it will be overwritten on update
 
-ACTION!="add|change", GOTO="persistent_storage_edd_end"
+ACTION=="remove", GOTO="persistent_storage_edd_end"
 SUBSYSTEM!="block", GOTO="persistent_storage_edd_end"
 KERNEL!="sd*|hd*|cciss*", GOTO="persistent_storage_edd_end"
 
index 2adfe04..2ded7d3 100644 (file)
@@ -1,2 +1,2 @@
-ACTION=="add|change", SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem|other", IMPORT="fstab_import $name $links mapper/$env{DM_NAME}"
+ACTION!="remove", SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem|other", IMPORT="fstab_import $name $links mapper/$env{DM_NAME}"
 
index 01ff30d..0687c8a 100644 (file)
@@ -1,6 +1,6 @@
 # do not edit this file, it will be overwritten on update
 
-ACTION!="add|change", GOTO="hid2hci_end"
+ACTION=="remove", GOTO="hid2hci_end"
 SUBSYSTEM!="usb", GOTO="hid2hci_end"
 
 # Variety of Dell Bluetooth devices - match on a mouse device that is
index f0e1ab8..b973614 100644 (file)
@@ -11,7 +11,7 @@
 # /lib/udev/keymap -i /dev/input/eventX
 # on a Linux vt to find out.
 
-ACTION!="add|change", GOTO="force_release_end"
+ACTION=="remove", GOTO="force_release_end"
 SUBSYSTEM!="serio", GOTO="force_release_end"
 KERNEL!="serio*", GOTO="force_release_end"
 DRIVER!="atkbd", GOTO="force_release_end"
index dd58453..2f41cb4 100644 (file)
@@ -5,7 +5,7 @@
 # a file name (in /lib/udev/keymaps), which has to contain scancode/keyname
 # pairs.
 
-ACTION!="add|change", GOTO="keyboard_end"
+ACTION=="remove", GOTO="keyboard_end"
 SUBSYSTEM!="input", GOTO="keyboard_end"
 KERNEL!="event*", GOTO="keyboard_end"
 
index fde2656..5b00bf8 100644 (file)
@@ -4,7 +4,7 @@
 # udev-acl of this udev release and may be replaced at any time.
 
 ENV{MAJOR}=="", GOTO="acl_end"
-ACTION!="add|change", GOTO="acl_apply"
+ACTION=="remove", GOTO="acl_apply"
 
 # PTP/MTP protocol devices, cameras, portable media players
 SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="", ENV{DEVTYPE}=="usb_device", IMPORT{program}="usb_id --export %p"
index c070fcc..ce51590 100644 (file)
@@ -353,12 +353,10 @@ int main (int argc, char* argv[])
 
                switch (option) {
                case 'a':
-                       if (strcmp(optarg, "add") == 0 || strcmp(optarg, "change") == 0)
-                               action = ACTION_ADD;
-                       else if (strcmp(optarg, "remove") == 0)
+                       if (strcmp(optarg, "remove") == 0)
                                action = ACTION_REMOVE;
                        else
-                               goto out;
+                               action = ACTION_ADD;
                        break;
                case 'D':
                        device = optarg;
index a342a71..b6e1313 100644 (file)
@@ -1,6 +1,6 @@
 # do not edit this file, it will be overwritten on update
 
-ACTION!="add|change", GOTO="persistent_v4l_end"
+ACTION=="remove", GOTO="persistent_v4l_end"
 SUBSYSTEM!="video4linux", GOTO="persistent_v4l_end"
 ENV{MAJOR}=="", GOTO="persistent_v4l_end"
 
index a5206fd..39a3652 100644 (file)
@@ -1,6 +1,6 @@
 # do not edit this file, it will be overwritten on update
 
-ACTION!="add|change", GOTO="persistent_alsa_end"
+ACTION=="remove", GOTO="persistent_alsa_end"
 SUBSYSTEM!="sound", GOTO="persistent_alsa_end"
 KERNEL!="controlC[0-9]*", GOTO="persistent_alsa_end"
 
index 1ea4431..634c4db 100644 (file)
@@ -1,6 +1,6 @@
 # do not edit this file, it will be overwritten on update
 
-ACTION!="add|change", GOTO="persistent_input_end"
+ACTION=="remove", GOTO="persistent_input_end"
 SUBSYSTEM!="input", GOTO="persistent_input_end"
 KERNEL=="input[0-9]*", GOTO="persistent_input_end"
 
index 351b385..3e1a565 100644 (file)
@@ -1,6 +1,6 @@
 # do not edit this file, it will be overwritten on update
 
-ACTION!="add|change", GOTO="persistent_serial_end"
+ACTION=="remove", GOTO="persistent_serial_end"
 SUBSYSTEM!="tty", GOTO="persistent_serial_end"
 KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="persistent_serial_end"
 
index 968528d..833ef94 100644 (file)
@@ -2,7 +2,7 @@
 
 # persistent storage links: /dev/tape/{by-id,by-path}
 
-ACTION!="add|change", GOTO="persistent_storage_tape_end"
+ACTION=="remove", GOTO="persistent_storage_tape_end"
 
 # type 8 devices are "Medium Changers"
 SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", IMPORT{program}="scsi_id --sg-version=3 --export --whitelisted -d $tempnode", SYMLINK+="tape/by-id/scsi-$env{ID_SERIAL}"
index 89041a9..d9f8003 100644 (file)
@@ -6,7 +6,7 @@
 # forward scsi device event to corresponding block device
 ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change"
 
-ACTION!="add|change", GOTO="persistent_storage_end"
+ACTION=="remove", GOTO="persistent_storage_end"
 SUBSYSTEM!="block", GOTO="persistent_storage_end"
 
 # skip rules for inappropriate block devices
index 1c4c401..490fcce 100644 (file)
@@ -1,6 +1,6 @@
 # do not edit this file, it will be overwritten on update
 
-ACTION!="add|change", GOTO="net_end"
+ACTION=="remove", GOTO="net_end"
 SUBSYSTEM!="net", GOTO="net_end"
 
 SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{program}="usb_id --export %p"
index ac868ad..c2980cf 100644 (file)
@@ -1,6 +1,6 @@
 # do not edit this file, it will be overwritten on update
 
-ACTION!="add|change", GOTO="tty_end"
+ACTION=="remove", GOTO="tty_end"
 SUBSYSTEM!="tty", GOTO="tty_end"
 
 SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{program}="usb_id --export %p"
index 34e3307..12cae35 100644 (file)
@@ -1,7 +1,7 @@
 # do not edit this file, it will be overwritten on update
 
 KERNEL!="dm-*", GOTO="device_mapper_end"
-ACTION!="add|change", GOTO="device_mapper_end"
+ACTION=="remove", GOTO="device_mapper_end"
 
 IMPORT{program}="/sbin/dmsetup export -j%M -m%m"
 ENV{DM_NAME}!="?*", GOTO="device_mapper_end"
index c4a2724..0361f68 100644 (file)
@@ -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));
 
index fe3352c..c27b4cd 100644 (file)
@@ -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);