From cad40a5fe75d876af22f68b688494b9cd98cc899 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sun, 12 Dec 2010 20:07:15 +0100 Subject: udevd: switch to common id_filename functions --- libudev/libudev-device-private.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libudev/libudev-device-private.c') diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c index bf93834c10..430e3e64d4 100644 --- a/libudev/libudev-device-private.c +++ b/libudev/libudev-device-private.c @@ -34,8 +34,12 @@ static void udev_device_tag(struct udev_device *dev, const char *tag, bool add) util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/tags/", tag, "/", id, NULL); if (add) { + int fd; + util_create_path(udev, filename); - symlink(udev_device_get_devpath(dev), filename); + fd = open(filename, O_WRONLY|O_CREAT|O_CLOEXEC|O_TRUNC|O_NOFOLLOW, 0444); + if (fd >= 0) + close(fd); } else { unlink(filename); } -- cgit v1.2.3-54-g00ecf