X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev-remove.c;h=9862a6f201baf757cfb91b345dcde8dfef2383f8;hb=bbab56baedd3e2f75d8a606d97d54c7a4d01d454;hp=cd917af193e6a05a128bebdba51720480ed25a0b;hpb=ea733a2f00174c3a39c8eb783e330b6a69abd67c;p=elogind.git diff --git a/udev-remove.c b/udev-remove.c index cd917af19..9862a6f20 100644 --- a/udev-remove.c +++ b/udev-remove.c @@ -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; } -