summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-05-13 11:24:37 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-05-13 15:42:26 -0400
commit35bca925f9bf78df3f64e321ab4830936fcef662 (patch)
tree979fbbaef24f26c97aeaf3ec7d1b9d0cb07dcbc0
parent6e4177315f632e03afea43b6d99100bd434f3403 (diff)
downloadsystemd-35bca925f9bf78df3f64e321ab4830936fcef662.tar.gz
tree-wide: fix incorrect uses of %m
In those cases errno was not set, so we would be logging some unrelated error or "Success".
-rw-r--r--src/import/import-raw.c4
-rw-r--r--src/import/import-tar.c4
-rw-r--r--src/libsystemd/sd-bus/test-bus-objects.c2
-rw-r--r--src/nspawn/nspawn.c2
-rw-r--r--src/stdio-bridge/stdio-bridge.c4
-rw-r--r--src/test/test-loopback.c2
6 files changed, 8 insertions, 10 deletions
diff --git a/src/import/import-raw.c b/src/import/import-raw.c
index 808eae38f8..55cf8e8edd 100644
--- a/src/import/import-raw.c
+++ b/src/import/import-raw.c
@@ -355,7 +355,7 @@ static int raw_import_process(RawImport *i) {
}
if (l == 0) {
if (i->compress.type == IMPORT_COMPRESS_UNKNOWN) {
- log_error("Premature end of file: %m");
+ log_error("Premature end of file.");
r = -EIO;
goto finish;
}
@@ -369,7 +369,7 @@ static int raw_import_process(RawImport *i) {
if (i->compress.type == IMPORT_COMPRESS_UNKNOWN) {
r = import_uncompress_detect(&i->compress, i->buffer, i->buffer_size);
if (r < 0) {
- log_error("Failed to detect file compression: %m");
+ log_error_errno(r, "Failed to detect file compression: %m");
goto finish;
}
if (r == 0) /* Need more data */
diff --git a/src/import/import-tar.c b/src/import/import-tar.c
index 1c229ec82f..ba140bccbd 100644
--- a/src/import/import-tar.c
+++ b/src/import/import-tar.c
@@ -284,7 +284,7 @@ static int tar_import_process(TarImport *i) {
}
if (l == 0) {
if (i->compress.type == IMPORT_COMPRESS_UNKNOWN) {
- log_error("Premature end of file: %m");
+ log_error("Premature end of file.");
r = -EIO;
goto finish;
}
@@ -298,7 +298,7 @@ static int tar_import_process(TarImport *i) {
if (i->compress.type == IMPORT_COMPRESS_UNKNOWN) {
r = import_uncompress_detect(&i->compress, i->buffer, i->buffer_size);
if (r < 0) {
- log_error("Failed to detect file compression: %m");
+ log_error_errno(r, "Failed to detect file compression: %m");
goto finish;
}
if (r == 0) /* Need more data */
diff --git a/src/libsystemd/sd-bus/test-bus-objects.c b/src/libsystemd/sd-bus/test-bus-objects.c
index 233a21a523..0b33ab7a3a 100644
--- a/src/libsystemd/sd-bus/test-bus-objects.c
+++ b/src/libsystemd/sd-bus/test-bus-objects.c
@@ -525,8 +525,6 @@ int main(int argc, char *argv[]) {
void *p;
int r, q;
- zero(c);
-
c.automatic_integer_property = 4711;
assert_se(c.automatic_string_property = strdup("dudeldu"));
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index a21fc1ba99..767d99201c 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -2029,7 +2029,7 @@ static int determine_names(void) {
if (r < 0)
return log_error_errno(r, "Failed to find image for machine '%s': %m", arg_machine);
if (r == 0) {
- log_error("No image for machine '%s': %m", arg_machine);
+ log_error("No image for machine '%s'.", arg_machine);
return -ENOENT;
}
diff --git a/src/stdio-bridge/stdio-bridge.c b/src/stdio-bridge/stdio-bridge.c
index ce8efce3d5..02ba5269dd 100644
--- a/src/stdio-bridge/stdio-bridge.c
+++ b/src/stdio-bridge/stdio-bridge.c
@@ -115,7 +115,7 @@ int main(int argc, char *argv[]) {
in_fd = SD_LISTEN_FDS_START;
out_fd = SD_LISTEN_FDS_START;
} else {
- log_error("Illegal number of file descriptors passed\n");
+ log_error("Illegal number of file descriptors passed.");
goto finish;
}
@@ -190,7 +190,7 @@ int main(int argc, char *argv[]) {
}
for (;;) {
- _cleanup_(sd_bus_message_unrefp)sd_bus_message *m = NULL;
+ _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
int events_a, events_b, fd;
uint64_t timeout_a, timeout_b, t;
struct timespec _ts, *ts;
diff --git a/src/test/test-loopback.c b/src/test/test-loopback.c
index 7b67337331..8ebd0e0e01 100644
--- a/src/test/test-loopback.c
+++ b/src/test/test-loopback.c
@@ -31,7 +31,7 @@ int main(int argc, char* argv[]) {
r = loopback_setup();
if (r < 0)
- log_error("loopback: %m");
+ log_error_errno(r, "loopback: %m");
return r >= 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}