diff options
Diffstat (limited to 'src/libudev')
-rw-r--r-- | src/libudev/libudev-device.c | 14 | ||||
-rw-r--r-- | src/libudev/libudev-private.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c index 2604ad7051..c0a061af6c 100644 --- a/src/libudev/libudev-device.c +++ b/src/libudev/libudev-device.c @@ -1986,6 +1986,20 @@ struct udev_device *udev_device_shallow_clone(struct udev_device *old_device) return device; } +struct udev_device *udev_device_clone_with_db(struct udev_device *old_device) +{ + struct udev_device *device; + + device = udev_device_shallow_clone(old_device); + if (!device) + return NULL; + + udev_device_read_db(device); + udev_device_set_info_loaded(device); + + return device; +} + struct udev_device *udev_device_new_from_nulstr(struct udev *udev, char *nulstr, ssize_t buflen) { struct udev_device *device; ssize_t bufpos = 0; diff --git a/src/libudev/libudev-private.h b/src/libudev/libudev-private.h index c0f9fbe763..a34c0f74e4 100644 --- a/src/libudev/libudev-private.h +++ b/src/libudev/libudev-private.h @@ -39,6 +39,7 @@ int udev_get_rules_path(struct udev *udev, char **path[], usec_t *ts_usec[]); /* libudev-device.c */ struct udev_device *udev_device_new_from_nulstr(struct udev *udev, char *nulstr, ssize_t buflen); struct udev_device *udev_device_shallow_clone(struct udev_device *old_device); +struct udev_device *udev_device_clone_with_db(struct udev_device *old_device); int udev_device_copy_properties(struct udev_device *dst, struct udev_device *src); mode_t udev_device_get_devnode_mode(struct udev_device *udev_device); uid_t udev_device_get_devnode_uid(struct udev_device *udev_device); |