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
@@ -885,7 +885,7 @@ fail:
|
||||
log_error("PAM failed: %s", pam_strerror(handle, pam_code));
|
||||
err = -EPERM; /* PAM errors do not map to errno */
|
||||
} else {
|
||||
log_error("PAM failed: %m");
|
||||
log_error_errno(errno, "PAM failed: %m");
|
||||
err = -errno;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user