- snprintf(filename, sizeof(filename), "%s/.udev/watch/%d", udev_get_dev_path(udev), wd);
- syslen = util_strlcpy(buf, udev_get_sys_path(udev), sizeof(buf));
- len = readlink(filename, &buf[syslen], sizeof(buf)-syslen);
- if (len > 0 || len < (ssize_t)(sizeof(buf)-syslen)) {
- buf[syslen + len] = '\0';
- return udev_device_new_from_syspath(udev, buf);
- }
+ snprintf(filename, sizeof(filename), "%s/watch/%d", udev_get_run_path(udev), wd);
+ s = majmin;
+ l = util_strpcpy(&s, sizeof(majmin), udev_get_sys_path(udev));
+ len = readlink(filename, s, l);
+ if (len <= 0 || (size_t)len == l)
+ return NULL;
+ s[len] = '\0';