chiark / gitweb /
[PATCH] udev spec file bits
[elogind.git] / udev-remove.c
index cd917af193e6a05a128bebdba51720480ed25a0b..9862a6f201baf757cfb91b345dcde8dfef2383f8 100644 (file)
@@ -31,6 +31,7 @@
 #include "udev.h"
 #include "udev_version.h"
 #include "namedev.h"
+#include "udevdb.h"
 #include "libsysfs/libsysfs.h"
 
 
@@ -44,6 +45,11 @@ static char *get_name(char *dev, int major, int minor)
        static char name[100];
        char *temp;
 
+       temp = udevdb_get_udevice_by_sysfs(dev);
+       dbg("udevdb_get_udevice_by_sysfs returned %s", temp);
+       if (temp != NULL)
+               return temp;
+       
        temp = strrchr(dev, '/');
        if (temp == NULL)
                return NULL;
@@ -80,9 +86,10 @@ int udev_remove_device(char *device, char *subsystem)
                goto exit;
        }
 
+       udevdb_delete_udevice(name);
+
        return delete_node(name);
 
 exit:
        return retval;
 }
-