From: Kay Sievers Date: Fri, 18 Dec 2009 20:25:13 +0000 (+0100) Subject: update mtime of nodes and links when we re-use them X-Git-Tag: 174~668 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=560739148143061336096dc3c021f94fe1bce37b;p=systemd update mtime of nodes and links when we re-use them --- diff --git a/udev/udev-node.c b/udev/udev-node.c index 24f2ccf6..c80a74c2 100644 --- a/udev/udev-node.c +++ b/udev/udev-node.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -55,6 +56,8 @@ int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mod info(udev, "preserve file '%s', because it has correct dev_t\n", file); preserve = 1; udev_selinux_lsetfilecon(udev, file, mode); + /* update time stamp when we re-use the node, like on media change events */ + utimes(file, NULL); } else { char file_tmp[UTIL_PATH_SIZE + sizeof(TMP_FILE_EXT)]; @@ -175,6 +178,7 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink) info(udev, "preserve already existing symlink '%s' to '%s'\n", slink, target); udev_selinux_lsetfilecon(udev, slink, S_IFLNK); + lutimes(slink, NULL); goto exit; } }