treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.
Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'
Plus some whitespace, linewrap, and indent adjustments.
This commit is contained in:
+1
-1
@@ -147,7 +147,7 @@ static int parse_file(Hashmap *sysctl_options, const char *path, bool ignore_eno
|
||||
if (feof(f))
|
||||
break;
|
||||
|
||||
log_error("Failed to read file '%s', ignoring: %m", path);
|
||||
log_error_errno(errno, "Failed to read file '%s', ignoring: %m", path);
|
||||
return -errno;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user