|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
From a530427e4eaf7ca69f223a86173ec37c282a34f9 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
Date: Sat, 13 May 2017 11:24:37 -0400
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
Subject: [PATCH] tree-wide: fix incorrect uses of %m
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
In those cases errno was not set, so we would be logging some unrelated error
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
or "Success".
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
(cherry picked from commit 35bca925f9bf78df3f64e321ab4830936fcef662)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
src/import/import-raw.c | 4 ++--
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
src/import/import-tar.c | 4 ++--
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
src/libsystemd/sd-bus/test-bus-objects.c | 2 --
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
src/nspawn/nspawn.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
src/stdio-bridge/stdio-bridge.c | 4 ++--
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
src/test/test-loopback.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
6 files changed, 8 insertions(+), 10 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
diff --git a/src/import/import-raw.c b/src/import/import-raw.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
index 808eae38f8..55cf8e8edd 100644
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
--- a/src/import/import-raw.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+++ b/src/import/import-raw.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
@@ -355,7 +355,7 @@ static int raw_import_process(RawImport *i) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (l == 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (i->compress.type == IMPORT_COMPRESS_UNKNOWN) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
- log_error("Premature end of file: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ log_error("Premature end of file.");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
r = -EIO;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
goto finish;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
@@ -369,7 +369,7 @@ static int raw_import_process(RawImport *i) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (i->compress.type == IMPORT_COMPRESS_UNKNOWN) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
r = import_uncompress_detect(&i->compress, i->buffer, i->buffer_size);
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
- log_error("Failed to detect file compression: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ log_error_errno(r, "Failed to detect file compression: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
goto finish;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (r == 0) /* Need more data */
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
diff --git a/src/import/import-tar.c b/src/import/import-tar.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
index 1c229ec82f..ba140bccbd 100644
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
--- a/src/import/import-tar.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+++ b/src/import/import-tar.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
@@ -284,7 +284,7 @@ static int tar_import_process(TarImport *i) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (l == 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (i->compress.type == IMPORT_COMPRESS_UNKNOWN) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
- log_error("Premature end of file: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ log_error("Premature end of file.");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
r = -EIO;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
goto finish;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
@@ -298,7 +298,7 @@ static int tar_import_process(TarImport *i) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (i->compress.type == IMPORT_COMPRESS_UNKNOWN) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
r = import_uncompress_detect(&i->compress, i->buffer, i->buffer_size);
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
- log_error("Failed to detect file compression: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ log_error_errno(r, "Failed to detect file compression: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
goto finish;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (r == 0) /* Need more data */
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
diff --git a/src/libsystemd/sd-bus/test-bus-objects.c b/src/libsystemd/sd-bus/test-bus-objects.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
index 233a21a523..0b33ab7a3a 100644
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
--- a/src/libsystemd/sd-bus/test-bus-objects.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+++ b/src/libsystemd/sd-bus/test-bus-objects.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
@@ -525,8 +525,6 @@ int main(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
void *p;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
int r, q;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
- zero(c);
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
c.automatic_integer_property = 4711;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
assert_se(c.automatic_string_property = strdup("dudeldu"));
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
index 1fc0501c2e..236c0f3149 100644
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
--- a/src/nspawn/nspawn.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+++ b/src/nspawn/nspawn.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
@@ -2012,7 +2012,7 @@ static int determine_names(void) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
return log_error_errno(r, "Failed to find image for machine '%s': %m", arg_machine);
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (r == 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
- log_error("No image for machine '%s': %m", arg_machine);
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ log_error("No image for machine '%s'.", arg_machine);
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
return -ENOENT;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
diff --git a/src/stdio-bridge/stdio-bridge.c b/src/stdio-bridge/stdio-bridge.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
index ce8efce3d5..02ba5269dd 100644
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
--- a/src/stdio-bridge/stdio-bridge.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+++ b/src/stdio-bridge/stdio-bridge.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
@@ -115,7 +115,7 @@ int main(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
in_fd = SD_LISTEN_FDS_START;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
out_fd = SD_LISTEN_FDS_START;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
} else {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
- log_error("Illegal number of file descriptors passed\n");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ log_error("Illegal number of file descriptors passed.");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
goto finish;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
@@ -190,7 +190,7 @@ int main(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
for (;;) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
- _cleanup_(sd_bus_message_unrefp)sd_bus_message *m = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
int events_a, events_b, fd;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
uint64_t timeout_a, timeout_b, t;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
struct timespec _ts, *ts;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
diff --git a/src/test/test-loopback.c b/src/test/test-loopback.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
index 7b67337331..8ebd0e0e01 100644
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
--- a/src/test/test-loopback.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+++ b/src/test/test-loopback.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
@@ -31,7 +31,7 @@ int main(int argc, char* argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
r = loopback_setup();
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
- log_error("loopback: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ log_error_errno(r, "loopback: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
return r >= 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
}
|