summaryrefslogtreecommitdiff
path: root/libudev/libudev-device-private.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2010-12-12 20:07:15 +0100
committerKay Sievers <kay.sievers@vrfy.org>2010-12-12 20:07:15 +0100
commitcad40a5fe75d876af22f68b688494b9cd98cc899 (patch)
treee83a3a87fe2d8e9de28febd10741a379ad711f63 /libudev/libudev-device-private.c
parent24d1076696ebe6696a8b8df414ab265aa6fc89c2 (diff)
udevd: switch to common id_filename functions
Diffstat (limited to 'libudev/libudev-device-private.c')
-rw-r--r--libudev/libudev-device-private.c6
1 files changed, 5 insertions, 1 deletions
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);
}