chiark / gitweb /
[PATCH] let klibc add the trailing newline to syslog conditionally
[elogind.git] / udev_remove.c
index 56834a45b929eaa1127944a9383d12baa8d4dfc4..8887125dd8aeba84b17ef77604a0456a2e86d101 100644 (file)
@@ -33,9 +33,9 @@
 #include "udev.h"
 #include "udev_lib.h"
 #include "udev_version.h"
-#include "logging.h"
 #include "namedev.h"
-#include "udevdb.h"
+#include "udev_db.h"
+#include "logging.h"
 
 static int delete_path(const char *path)
 {
@@ -175,7 +175,7 @@ int udev_remove_device(struct udevice *udev)
        if (udev->type != 'b' && udev->type != 'c')
                return 0;
 
-       retval = udevdb_get_dev(udev);
+       retval = udev_db_get_device(udev);
        if (retval) {
                /* fall back to kernel name */
                temp = strrchr(udev->devpath, '/');
@@ -185,8 +185,13 @@ int udev_remove_device(struct udevice *udev)
                dbg("'%s' not found in database, falling back on default name", udev->name);
        }
 
+       if (udev->ignore_remove) {
+               dbg("remove event for '%s' requested to be ignored by rule", udev->name);
+               return 0;
+       }
+
        dbg("remove name='%s'", udev->name);
-       udevdb_delete_dev(udev);
+       udev_db_delete_device(udev);
 
        /* use full path to the environment */
        snprintf(udev->devname, NAME_SIZE, "%s/%s", udev_root, udev->name);