diff options
author | Daniel Buch <boogiewasthere@gmail.com> | 2013-11-26 09:38:02 +0100 |
---|---|---|
committer | David Strauss <david@davidstrauss.net> | 2013-11-26 21:07:46 +1000 |
commit | f5f6d0e25574dd63fb605b81fa7767dd71c454db (patch) | |
tree | 3ec0b42888ce9b6895ec264c2a18a394c6d3db3e /src/core | |
parent | 34a6dc7dcaa47a9efe083acc6f5fc6263414465e (diff) |
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"
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/automount.c | 2 | ||||
-rw-r--r-- | src/core/main.c | 2 | ||||
-rw-r--r-- | src/core/manager.c | 2 | ||||
-rw-r--r-- | src/core/mount-setup.c | 2 | ||||
-rw-r--r-- | src/core/service.c | 4 |
5 files changed, 6 insertions, 6 deletions
diff --git a/src/core/automount.c b/src/core/automount.c index 49a64b124f..66e3d78c92 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -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; } diff --git a/src/core/main.c b/src/core/main.c index dbc98db84a..69d3a43840 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -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 = {}; diff --git a/src/core/manager.c b/src/core/manager.c index aa4baaacc8..65cb73cc9f 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -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; diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c index 73c2698ea3..c601c9742c 100644 --- a/src/core/mount-setup.c +++ b/src/core/mount-setup.c @@ -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; } diff --git a/src/core/service.c b/src/core/service.c index 28b1465c19..7c5d5d8681 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -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; } |