[systemd-commits] src/libudev src/udev

David Herrmann dvdhrm at kemper.freedesktop.org
Thu Sep 18 06:33:04 PDT 2014


 src/libudev/libudev-device.c  |    2 +-
 src/libudev/libudev-private.h |    1 +
 src/udev/udev-event.c         |    1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 572016d1c2c5a679ea3ac95ff15ce9f3508020f3
Author: Robert Milasan <rmilasan at suse.com>
Date:   Sat Sep 13 15:18:37 2014 +0200

    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)

diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c
index d61a2ad..2699374 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 2f74bc0..7e11f73 100644
--- a/src/libudev/libudev-private.h
+++ b/src/libudev/libudev-private.h
@@ -59,6 +59,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);
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
index dc1f682..30a6708 100644
--- a/src/udev/udev-event.c
+++ b/src/udev/udev-event.c
@@ -813,6 +813,7 @@ void udev_event_execute_rules(struct udev_event *event,
                 if (event->dev_db != NULL) {
                         udev_device_set_syspath(event->dev_db, udev_device_get_syspath(dev));
                         udev_device_set_subsystem(event->dev_db, udev_device_get_subsystem(dev));
+                        udev_device_set_devnum(event->dev_db, udev_device_get_devnum(dev));
                         udev_device_read_db(event->dev_db, NULL);
                         udev_device_set_info_loaded(event->dev_db);
 



More information about the systemd-commits mailing list