summaryrefslogtreecommitdiff
path: root/src/libudev
diff options
context:
space:
mode:
authorRobert Milasan <rmilasan@suse.com>2014-09-13 15:18:37 +0200
committerAnthony G. Basile <blueness@gentoo.org>2014-09-18 18:48:25 -0400
commita580624ac3f9c49e94b0ff97c6df459b87d6afac (patch)
tree749f69086ba99f91368020830e209422ea619123 /src/libudev
parentabc50f3d922a50905063c2cc0dd64dfd1b0b9e6c (diff)
udev: fix path for database names on 'change' event
If a device does not have a major/minor number attached, we use different database names than if it does. On "change" events, we didn't copy the devnum over, therefore, we used different paths than on 'add' or 'remove' events (where devnum was properly copied). Fix this by always copying the devnum into the udev-device. (David: added commit-log from email) Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/libudev')
-rw-r--r--src/libudev/libudev-device.c2
-rw-r--r--src/libudev/libudev-private.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c
index d61a2ad8f4..2699374072 100644
--- a/src/libudev/libudev-device.c
+++ b/src/libudev/libudev-device.c
@@ -161,7 +161,7 @@ _public_ dev_t udev_device_get_devnum(struct udev_device *udev_device)
return udev_device->devnum;
}
-static int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum)
+int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum)
{
char num[32];
diff --git a/src/libudev/libudev-private.h b/src/libudev/libudev-private.h
index 9ec2931d5b..09e786c320 100644
--- a/src/libudev/libudev-private.h
+++ b/src/libudev/libudev-private.h
@@ -60,6 +60,7 @@ uid_t udev_device_get_devnode_uid(struct udev_device *udev_device);
gid_t udev_device_get_devnode_gid(struct udev_device *udev_device);
int udev_device_set_subsystem(struct udev_device *udev_device, const char *subsystem);
int udev_device_set_syspath(struct udev_device *udev_device, const char *syspath);
+int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum);
int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink);
void udev_device_cleanup_devlinks_list(struct udev_device *udev_device);
struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value);