Commits

consus  committed 8532fa7

udev: check return value of symlink

  • Participants
  • Parent commits e105254

Comments (0)

Files changed (1)

File src/udev-watch.c

 {
         char filename[UTIL_PATH_SIZE];
         int wd;
+        int err;
 
         if (inotify_fd < 0)
                 return;
         snprintf(filename, sizeof(filename), "%s/watch/%d", udev_get_run_path(udev), wd);
         util_create_path(udev, filename);
         unlink(filename);
-        symlink(udev_device_get_id_filename(dev), filename);
+        err = symlink(udev_device_get_id_filename(dev), filename);
+        if (err != 0)
+             err(udev, "symlink '%s' '%s' failed: %m\n",
+                 udev_device_get_id_filename(dev), filename);
 
         udev_device_set_watch_handle(dev, wd);
 }