summaryrefslogtreecommitdiff
path: root/src/libudev/libudev-device.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-03-05 17:44:12 +0100
committerAnthony G. Basile <blueness@gentoo.org>2015-03-18 19:33:52 -0400
commitced0d2419e3fc88e29f8076363deb4214b87f0f2 (patch)
tree91aa7c7e8bc69cf264bc8ef16f1911e2b622c0b6 /src/libudev/libudev-device.c
parent95186c2ee4b0507afc393afa0ba99050bef05324 (diff)
udev/libudev: event - move {OLD_,}INTERFACE handling from udevd to libudev
This should be internal to the library as it is only about reflecting the sysfs state in the udev_device. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/libudev/libudev-device.c')
-rw-r--r--src/libudev/libudev-device.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c
index 9863901a33..9f1787b395 100644
--- a/src/libudev/libudev-device.c
+++ b/src/libudev/libudev-device.c
@@ -1926,6 +1926,7 @@ void udev_device_set_db_persist(struct udev_device *udev_device)
int udev_device_rename(struct udev_device *udev_device, const char *name)
{
_cleanup_free_ char *dirname = NULL;
+ const char *interface;
char *new_syspath;
int r;
@@ -1942,6 +1943,13 @@ int udev_device_rename(struct udev_device *udev_device, const char *name)
if (r < 0)
return r;
+ interface = udev_device_get_property_value(udev_device, "INTERFACE");
+ if (interface) {
+ /* like DEVPATH_OLD, INTERFACE_OLD is not saved to the db, but only stays around for the current event */
+ udev_device_add_property(udev_device, "INTERFACE_OLD", interface);
+ udev_device_add_property(udev_device, "INTERFACE", name);
+ }
+
return 0;
}