chiark / gitweb /
Use %m instead of strerror(errno) where appropiate
authorCristian Rodríguez <crrodriguez@opensuse.org>
Sat, 24 May 2014 04:10:36 +0000 (00:10 -0400)
committerLennart Poettering <lennart@poettering.net>
Sun, 25 May 2014 03:18:28 +0000 (11:18 +0800)
src/journal/sd-journal.c
src/libsystemd-network/sd-dhcp-client.c
src/nspawn/nspawn.c
src/shared/label.c

index 11de8ef..ca805f8 100644 (file)
@@ -1455,8 +1455,7 @@ static int add_directory(sd_journal *j, const char *prefix, const char *dirname)
                 de = readdir(d);
                 if (!de && errno != 0) {
                         r = -errno;
-                        log_debug("Failed to read directory %s: %s",
-                                  m->path, strerror(errno));
+                        log_debug("Failed to read directory %s: %m", m->path);
                         return r;
                 }
                 if (!de)
@@ -1546,8 +1545,7 @@ static int add_root_directory(sd_journal *j, const char *p) {
                 de = readdir(d);
                 if (!de && errno != 0) {
                         r = -errno;
-                        log_debug("Failed to read directory %s: %s",
-                                  m->path, strerror(errno));
+                        log_debug("Failed to read directory %s: %m", m->path);
                         return r;
                 }
                 if (!de)
index 67593c4..0300a6b 100644 (file)
@@ -1200,7 +1200,7 @@ static int client_receive_message_udp(sd_event_source *s, int fd,
         len = read(fd, message, buflen);
         if (len < 0) {
                 log_dhcp_client(client, "could not receive message from UDP "
-                                "socket: %s", strerror(errno));
+                                "socket: %m");
                 return 0;
         } else if ((size_t)len < sizeof(DHCPMessage))
                 return 0;
@@ -1245,7 +1245,7 @@ static int client_receive_message_raw(sd_event_source *s, int fd,
         len = recvmsg(fd, &msg, 0);
         if (len < 0) {
                 log_dhcp_client(client, "could not receive message from raw "
-                                "socket: %s", strerror(errno));
+                                "socket: %m");
                 return 0;
         } else if ((size_t)len < sizeof(DHCPPacket))
                 return 0;
index eb9c5e0..73158a0 100644 (file)
@@ -657,7 +657,7 @@ static int mount_binds(const char *dest, char **l, unsigned long flags) {
                                 return r;
                         }
                 } else {
-                        log_error("Failed to bind mount %s: %s", *x, strerror(errno));
+                        log_error("Failed to bind mount %s: %m", *x);
                         return -errno;
                 }
                 /* Create the mount point, but be conservative -- refuse to create block
index 70e5c85..3b7b86e 100644 (file)
@@ -79,7 +79,7 @@ static int smack_relabel_in_dev(const char *path) {
 
         r = setxattr(path, "security.SMACK64", label, strlen(label), 0);
         if (r < 0) {
-                log_error("Smack relabeling \"%s\" %s", path, strerror(errno));
+                log_error("Smack relabeling \"%s\" %m", path);
                 return -errno;
         }
 #endif