log_debug("sd-device: %s does not have an uevent file: %m", syspath);
return -errno;
}
} else {
/* everything else just just needs to be a directory */
log_debug("sd-device: %s does not have an uevent file: %m", syspath);
return -errno;
}
} else {
/* everything else just just needs to be a directory */
- if (!is_dir(syspath, false)) {
- log_debug("sd-device: %s is not a directory", syspath);
- return -EINVAL;
- }
+ if (!is_dir(syspath, false))
+ return -ENODEV;
log_debug("sd-device: could not set 'MAJOR=%s' or 'MINOR=%s' from '%s': %s", major, minor, path, strerror(-r));
}
log_debug("sd-device: could not set 'MAJOR=%s' or 'MINOR=%s' from '%s': %s", major, minor, path, strerror(-r));
}
r = device_set_subsystem(device, "drivers");
else if (path_startswith(device->devpath, "/subsystem/") ||
path_startswith(device->devpath, "/class/") ||
r = device_set_subsystem(device, "drivers");
else if (path_startswith(device->devpath, "/subsystem/") ||
path_startswith(device->devpath, "/class/") ||
streq(subsystem, "block") ? 'b' : 'c',
major(devnum), minor(devnum));
if (r < 0)
streq(subsystem, "block") ? 'b' : 'c',
major(devnum), minor(devnum));
if (r < 0)
} else if (ifindex > 0) {
/* use netdev ifindex -- n3 */
r = asprintf(&id, "n%u", ifindex);
if (r < 0)
} else if (ifindex > 0) {
/* use netdev ifindex -- n3 */
r = asprintf(&id, "n%u", ifindex);
if (r < 0)
} else {
/* use $subsys:$sysname -- pci:0000:00:1f.2
* sysname() has '!' translated, get it from devpath
} else {
/* use $subsys:$sysname -- pci:0000:00:1f.2
* sysname() has '!' translated, get it from devpath
r = asprintf(&id, "+%s:%s", subsystem, sysname);
if (r < 0)
r = asprintf(&id, "+%s:%s", subsystem, sysname);
if (r < 0)