# libudev
# ------------------------------------------------------------------------------
LIBUDEV_CURRENT=9
-LIBUDEV_REVISION=0
+LIBUDEV_REVISION=1
LIBUDEV_AGE=9
SUBDIRS += libudev/docs
unlink(filename);
return 0;
}
-
-int udev_device_rename_db(struct udev_device *udev_device)
-{
- struct udev *udev = udev_device_get_udev(udev_device);
- char filename_old[UTIL_PATH_SIZE];
- char filename[UTIL_PATH_SIZE];
-
- if (strcmp(udev_device_get_sysname(udev_device), udev_device_get_sysname_old(udev_device)) == 0)
- return 0;
-
- util_strscpyl(filename_old, sizeof(filename_old), udev_get_dev_path(udev), "/.udev/db/",
- udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname_old(udev_device), NULL);
- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db/",
- udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL);
- return rename(filename_old, filename);
-}
/* libudev-device-private.c */
int udev_device_update_db(struct udev_device *udev_device);
int udev_device_delete_db(struct udev_device *udev_device);
-int udev_device_rename_db(struct udev_device *udev_device);
int udev_device_tag_index(struct udev_device *dev, struct udev_device *dev_old, bool add);
/* libudev-monitor.c - netlink/unix socket communication */
break;
case DEVICE_FINISHED:
- if (udev_device_get_sysname_old(udev_device) != NULL &&
- strcmp(udev_device_get_sysname_old(udev_device), udev_device_get_sysname(udev_device)) != 0) {
- /* "move" event - rename failed file to current name, do not delete failed */
- char filename_old[UTIL_PATH_SIZE];
-
- util_strscpyl(filename_old, sizeof(filename_old), udev_get_dev_path(udev), "/.udev/failed/",
- udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname_old(udev_device), NULL);
- if (rename(filename_old, filename) == 0)
- info(udev, "renamed devpath, moved failed state of '%s' to %s'\n",
- udev_device_get_devpath_old(udev_device), udev_device_get_devpath(udev_device));
- }
break;
}
struct udev_device *dev = event->dev;
int err = 0;
- if (udev_device_get_sysname_old(dev) != NULL &&
- strcmp(udev_device_get_sysname_old(dev), udev_device_get_sysname(dev)) != 0) {
- udev_device_rename_db(dev);
- info(event->udev, "moved database from '%s:%s' to '%s:%s'\n",
- udev_device_get_subsystem(dev), udev_device_get_sysname_old(dev),
- udev_device_get_subsystem(dev), udev_device_get_sysname(dev));
- }
-
if (strcmp(udev_device_get_action(dev), "remove") == 0) {
udev_device_read_db(dev);
udev_device_delete_db(dev);