tree-wide usage of %m specifier instead of strerror(errno)

Also for log_error() except where a specific error is specified

e.g. errno ? strerror(errno) : "Some user specified message"
This commit is contained in:
Daniel Buch
2013-11-26 21:07:46 +10:00
committed by David Strauss
parent 34a6dc7dca
commit f5f6d0e255
14 changed files with 23 additions and 29 deletions
+1 -1
View File
@@ -304,7 +304,7 @@ static int open_dev_autofs(Manager *m) {
m->dev_autofs_fd = open("/dev/autofs", O_CLOEXEC|O_RDONLY);
if (m->dev_autofs_fd < 0) {
log_error("Failed to open /dev/autofs: %s", strerror(errno));
log_error("Failed to open /dev/autofs: %m");
return -errno;
}
+1 -1
View File
@@ -131,7 +131,7 @@ _noreturn_ static void crash(int sig) {
pid = fork();
if (pid < 0)
log_error("Caught <%s>, cannot fork for core dump: %s", signal_to_string(sig), strerror(errno));
log_error("Caught <%s>, cannot fork for core dump: %m", signal_to_string(sig));
else if (pid == 0) {
struct rlimit rl = {};
+1 -1
View File
@@ -307,7 +307,7 @@ static int enable_special_signals(Manager *m) {
} else {
/* Enable that we get SIGWINCH on kbrequest */
if (ioctl(fd, KDSIGACCEPT, SIGWINCH) < 0)
log_warning("Failed to enable kbrequest handling: %s", strerror(errno));
log_warning("Failed to enable kbrequest handling: %m");
}
return 0;
+1 -1
View File
@@ -188,7 +188,7 @@ static int mount_one(const MountPoint *p, bool relabel) {
p->type,
p->flags,
p->options) < 0) {
log_full((p->mode & MNT_FATAL) ? LOG_ERR : LOG_DEBUG, "Failed to mount %s: %s", p->where, strerror(errno));
log_full((p->mode & MNT_FATAL) ? LOG_ERR : LOG_DEBUG, "Failed to mount %s: %m", p->where);
return (p->mode & MNT_FATAL) ? -errno : 0;
}
+2 -2
View File
@@ -3507,7 +3507,7 @@ static int service_enumerate(Manager *m) {
d = opendir(path);
if (!d) {
if (errno != ENOENT)
log_warning("opendir(%s) failed: %s", path, strerror(errno));
log_warning("opendir(%s) failed: %m", path);
continue;
}
@@ -3540,7 +3540,7 @@ static int service_enumerate(Manager *m) {
if (access(fpath, X_OK) < 0) {
if (errno != ENOENT)
log_warning("access() failed on %s: %s", fpath, strerror(errno));
log_warning("access() failed on %s: %m", fpath);
continue;
}