Merge pull request #5958 from keszybz/explicit-log-errno
Use explicit errno in log calls
This commit is contained in:
@@ -525,8 +525,6 @@ int main(int argc, char *argv[]) {
|
||||
void *p;
|
||||
int r, q;
|
||||
|
||||
zero(c);
|
||||
|
||||
c.automatic_integer_property = 4711;
|
||||
assert_se(c.automatic_string_property = strdup("dudeldu"));
|
||||
|
||||
|
||||
@@ -631,10 +631,8 @@ static int enumerator_scan_devices_tag(sd_device_enumerator *enumerator, const c
|
||||
if (!dir) {
|
||||
if (errno == ENOENT)
|
||||
return 0;
|
||||
else {
|
||||
log_error("sd-device-enumerator: could not open tags directory %s: %m", path);
|
||||
return -errno;
|
||||
}
|
||||
else
|
||||
return log_error_errno(errno, "sd-device-enumerator: could not open tags directory %s: %m", path);
|
||||
}
|
||||
|
||||
/* TODO: filter away subsystems? */
|
||||
@@ -758,10 +756,8 @@ static int parent_crawl_children(sd_device_enumerator *enumerator, const char *p
|
||||
int r = 0;
|
||||
|
||||
dir = opendir(path);
|
||||
if (!dir) {
|
||||
log_debug("sd-device-enumerate: could not open parent directory %s: %m", path);
|
||||
return -errno;
|
||||
}
|
||||
if (!dir)
|
||||
return log_debug_errno(errno, "sd-device-enumerate: could not open parent directory %s: %m", path);
|
||||
|
||||
FOREACH_DIRENT_ALL(dent, dir, return -errno) {
|
||||
_cleanup_free_ char *child = NULL;
|
||||
|
||||
@@ -195,8 +195,7 @@ int device_set_syspath(sd_device *device, const char *_syspath, bool verify) {
|
||||
/* this is not a valid device */
|
||||
return -ENODEV;
|
||||
|
||||
log_debug("sd-device: %s does not have an uevent file: %m", syspath);
|
||||
return -errno;
|
||||
return log_debug_errno(errno, "sd-device: %s does not have an uevent file: %m", syspath);
|
||||
}
|
||||
} else {
|
||||
/* everything else just needs to be a directory */
|
||||
|
||||
Reference in New Issue
Block a user