1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-25 21:57:32 +03:00

Use %m instead of strerror(errno) where appropiate

This commit is contained in:
Cristian Rodríguez 2014-05-24 00:10:36 -04:00 committed by Lennart Poettering
parent 552c693eea
commit 590b6b9188
4 changed files with 6 additions and 8 deletions

View 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)

View 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;

View 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

View 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