summaryrefslogtreecommitdiffstats
path: root/src/udev/udev-watch.c
diff options
context:
space:
mode:
authorVáclav Pavlín <vpavlin@redhat.com>2012-09-21 12:52:08 +0200
committerKay Sievers <kay@vrfy.org>2012-09-23 14:24:43 +0200
commit6bb2f0a08a321eb165b28de1584884bdfc0c27ee (patch)
tree0d906495c611e1f3ce14e197016fe128e56a44f2 /src/udev/udev-watch.c
parentlibudev: check return value of rename (diff)
downloadsystemd-6bb2f0a08a321eb165b28de1584884bdfc0c27ee.tar.xz
systemd-6bb2f0a08a321eb165b28de1584884bdfc0c27ee.zip
udev: check return value of symlink
Diffstat (limited to 'src/udev/udev-watch.c')
-rw-r--r--src/udev/udev-watch.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/udev/udev-watch.c b/src/udev/udev-watch.c
index c27a280bd3..eebcee6555 100644
--- a/src/udev/udev-watch.c
+++ b/src/udev/udev-watch.c
@@ -98,6 +98,7 @@ void udev_watch_begin(struct udev *udev, struct udev_device *dev)
{
char filename[UTIL_PATH_SIZE];
int wd;
+ int r;
if (inotify_fd < 0)
return;
@@ -113,7 +114,9 @@ void udev_watch_begin(struct udev *udev, struct udev_device *dev)
snprintf(filename, sizeof(filename), "/run/udev/watch/%d", wd);
mkdir_parents(filename, 0755);
unlink(filename);
- symlink(udev_device_get_id_filename(dev), filename);
+ r = symlink(udev_device_get_id_filename(dev), filename);
+ if (r < 0)
+ log_error("Failed to create symlink: %m");
udev_device_set_watch_handle(dev, wd);
}