]> err.no Git - systemd/commitdiff
do not delete the device node with ignore_remove, but handle the event
authorKay Sievers <kay.sievers@vrfy.org>
Wed, 29 Aug 2007 12:11:37 +0000 (14:11 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Wed, 29 Aug 2007 12:11:37 +0000 (14:11 +0200)
udev.7
udev.xml
udev_device.c
udev_rules.c

diff --git a/udev.7 b/udev.7
index 0ea554923d55581afb3101076f1172de7af032e8..874c9abe3809b2ff1956e1f528c35bab428b580a 100644 (file)
--- a/udev.7
+++ b/udev.7
@@ -275,7 +275,7 @@ Ignore this event completely\.
 .PP
 \fBignore_remove\fR
 .RS 4
-Ignore any later remove event for this device\. This may be useful as a workaround for broken device drivers\.
+Do not remove the device node when the device goes away\. This may be useful as a workaround for broken device drivers\.
 .RE
 .PP
 \fBlink_priority=\fR\fB\fIvalue\fR\fR
index 9fb615294159cafdef5a4d13823f4abbef8a54ca..83a9d754ca0abaf8cd505239a4eff1161619c6b9 100644 (file)
--- a/udev.xml
+++ b/udev.xml
                   <varlistentry>
                     <term><option>ignore_remove</option></term>
                     <listitem>
-                      <para>Ignore any later remove event for this device. This may be useful
-                      as a workaround for broken device drivers.</para>
+                      <para>Do not remove the device node when the device goes away. This may be
+                      useful as a workaround for broken device drivers.</para>
                     </listitem>
                   </varlistentry>
                   <varlistentry>
index 2b7ffe0bf44adcac23414c64d51d04d77278b98c..62217ff58509564aea08c219461f41fdabeb0c77 100644 (file)
@@ -266,10 +266,6 @@ int udev_device_event(struct udev_rules *rules, struct udevice *udev)
                /* import database entry, and delete it */
                if (udev_db_get_device(udev, udev->dev->devpath) == 0) {
                        udev_db_delete_device(udev);
-                       if (udev->ignore_remove) {
-                               info("ignore_remove for '%s'", udev->name);
-                               goto exit;
-                       }
                        /* restore stored persistent data */
                        list_for_each_entry(name_loop, &udev->env_list, node)
                                putenv(name_loop->name);
@@ -285,6 +281,10 @@ int udev_device_event(struct udev_rules *rules, struct udevice *udev)
                        goto exit;
                }
 
+               if (udev->ignore_remove) {
+                       info("ignore_remove for '%s'", udev->name);
+                       goto exit;
+               }
                /* remove the node */
                retval = udev_node_remove(udev);
 
index 01fb2117b25d2499fa3dcabffdc398a2a8bb2906..364d1b7adc727aec4d71df15fb62b9eb1ce613fc 100644 (file)
@@ -1472,9 +1472,14 @@ int udev_rules_get_run(struct udev_rules *rules, struct udevice *udev)
                        break;
 
                dbg("process rule");
-               if (rule->name.operation != KEY_OP_UNSET || rule->symlink.operation != KEY_OP_UNSET ||
-                   rule->mode_operation != KEY_OP_UNSET || rule->owner.operation != KEY_OP_UNSET ||
-                   rule->group.operation != KEY_OP_UNSET) {
+               if (rule->name.operation == KEY_OP_ASSIGN ||
+                   rule->name.operation == KEY_OP_ASSIGN_FINAL ||
+                   rule->name.operation == KEY_OP_ADD ||
+                   rule->symlink.operation == KEY_OP_ASSIGN ||
+                   rule->symlink.operation == KEY_OP_ASSIGN_FINAL ||
+                   rule->symlink.operation == KEY_OP_ADD ||
+                   rule->mode_operation != KEY_OP_UNSET ||
+                   rule->owner.operation != KEY_OP_UNSET || rule->group.operation != KEY_OP_UNSET) {
                        dbg("skip rule that names a device");
                        continue;
                }
@@ -1485,6 +1490,10 @@ int udev_rules_get_run(struct udev_rules *rules, struct udevice *udev)
                                udev->ignore_device = 1;
                                return 0;
                        }
+                       if (rule->ignore_remove) {
+                               udev->ignore_remove = 1;
+                               dbg("remove event should be ignored");
+                       }
 
                        if (!udev->run_final && rule->run.operation != KEY_OP_UNSET) {
                                struct name_entry *entry;