sd-device: improve log message and tweak style
We shouldn't say the attribute is missing right after ruling out ENOENT.
This commit is contained in:
@@ -178,13 +178,12 @@ int device_set_syspath(sd_device *device, const char *_syspath, bool verify) {
|
||||
|
||||
/* all 'devices' require an 'uevent' file */
|
||||
path = strjoina(syspath, "/uevent");
|
||||
r = access(path, F_OK);
|
||||
if (r < 0) {
|
||||
if (access(path, F_OK) < 0) {
|
||||
if (errno == ENOENT)
|
||||
/* this is not a valid device */
|
||||
return -ENODEV;
|
||||
|
||||
return log_debug_errno(errno, "sd-device: %s does not have an uevent file: %m", syspath);
|
||||
return log_debug_errno(errno, "sd-device: cannot access uevent file for %s: %m", syspath);
|
||||
}
|
||||
} else {
|
||||
/* everything else just needs to be a directory */
|
||||
|
||||
Reference in New Issue
Block a user