summaryrefslogtreecommitdiff
path: root/libudev/libudev-device-private.c
diff options
context:
space:
mode:
Diffstat (limited to 'libudev/libudev-device-private.c')
-rw-r--r--libudev/libudev-device-private.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c
index 406d8704f5..d1df45ee74 100644
--- a/libudev/libudev-device-private.c
+++ b/libudev/libudev-device-private.c
@@ -114,7 +114,9 @@ int udev_device_update_db(struct udev_device *udev_device)
util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db/", id, NULL);
/* do not store anything for otherwise empty devices */
- if (!has_info && udev_device_get_devnode(udev_device) == NULL) {
+ if (!has_info &&
+ major(udev_device_get_devnum(udev_device)) == 0 &&
+ udev_device_get_ifindex(udev_device) == 0) {
unlink(filename);
return 0;
}