chiark / gitweb /
libvolume_id: squashfs - add endianess support for LZMA compression
[elogind.git] / udev_device.c
index 23ba313db3098e85cc91f50a38c678a6e86e6381..62217ff58509564aea08c219461f41fdabeb0c77 100644 (file)
@@ -168,6 +168,10 @@ int udev_device_event(struct udev_rules *rules, struct udevice *udev)
 {
        int retval = 0;
 
+       if (udev->devpath_old != NULL)
+               if (udev_db_rename(udev->devpath_old, udev->dev->devpath) == 0)
+                       info("moved database from '%s' to '%s'", udev->devpath_old, udev->dev->devpath);
+
        /* add device node */
        if (major(udev->devt) != 0 &&
            (strcmp(udev->action, "add") == 0 || strcmp(udev->action, "change") == 0)) {
@@ -262,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);
@@ -281,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);