X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flibudev%2Flibudev-device.c;h=978b03dd0da02dd97052c7d781da8ccc978b290d;hp=d0296b7ccb5be1ad136a0849cf24675e4845a99c;hb=3738cc858d6d1312f66a31d2f7652328bb317876;hpb=bd57b6de74c6ff77f0220bf08d43a7e41f4316e9 diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c index d0296b7cc..978b03dd0 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; }