udev-node: stack directory must exist when adding device node symlink

This commit is contained in:
Yu Watanabe
2021-09-02 08:30:51 +09:00
parent 2f48561e0d
commit 46070dbf26
+6 -5
View File
@@ -161,12 +161,13 @@ static int link_find_prioritized(sd_device *dev, bool add, const char *stackdir,
dir = opendir(stackdir);
if (!dir) {
if (errno == ENOENT) {
*ret = TAKE_PTR(target);
return !!*ret;
}
if (add) /* The stack directory must exist. */
return -errno;
if (errno != ENOENT)
return -errno;
return -errno;
*ret = NULL;
return 0;
}
r = device_get_device_id(dev, &id);