|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From 572016d1c2c5a679ea3ac95ff15ce9f3508020f3 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Robert Milasan <rmilasan@suse.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Sat, 13 Sep 2014 15:18:37 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] udev: fix path for database names on 'change' event
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
If a device does not have a major/minor number attached, we use different
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
database names than if it does. On "change" events, we didn't copy the
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
devnum over, therefore, we used different paths than on 'add' or 'remove'
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
events (where devnum was properly copied).
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Fix this by always copying the devnum into the udev-device.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
(David: added commit-log from email)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libudev/libudev-device.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libudev/libudev-private.h | 1 +
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/udev/udev-event.c | 1 +
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
3 files changed, 3 insertions(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index d61a2ad8f4..2699374072 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libudev/libudev-device.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libudev/libudev-device.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -161,7 +161,7 @@ _public_ dev_t udev_device_get_devnum(struct udev_device *udev_device)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return udev_device->devnum;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-static int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
{
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
char num[32];
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libudev/libudev-private.h b/src/libudev/libudev-private.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 2f74bc0883..7e11f7326d 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libudev/libudev-private.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libudev/libudev-private.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -59,6 +59,7 @@ uid_t udev_device_get_devnode_uid(struct udev_device *udev_device);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
gid_t udev_device_get_devnode_gid(struct udev_device *udev_device);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
int udev_device_set_subsystem(struct udev_device *udev_device, const char *subsystem);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
int udev_device_set_syspath(struct udev_device *udev_device, const char *syspath);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
void udev_device_cleanup_devlinks_list(struct udev_device *udev_device);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index dc1f682bfe..30a6708901 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/udev/udev-event.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/udev/udev-event.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -813,6 +813,7 @@ void udev_event_execute_rules(struct udev_event *event,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (event->dev_db != NULL) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
udev_device_set_syspath(event->dev_db, udev_device_get_syspath(dev));
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
udev_device_set_subsystem(event->dev_db, udev_device_get_subsystem(dev));
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ udev_device_set_devnum(event->dev_db, udev_device_get_devnum(dev));
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
udev_device_read_db(event->dev_db, NULL);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
udev_device_set_info_loaded(event->dev_db);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|