]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: fix incorrect uses of %m
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 13 May 2017 15:24:37 +0000 (11:24 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 13 May 2017 19:42:26 +0000 (15:42 -0400)
In those cases errno was not set, so we would be logging some unrelated error
or "Success".

src/import/import-raw.c
src/import/import-tar.c
src/libsystemd/sd-bus/test-bus-objects.c
src/nspawn/nspawn.c
src/stdio-bridge/stdio-bridge.c
src/test/test-loopback.c

index 808eae38f88300c409d8f8068b2c6673c15fc590..55cf8e8edda36ed2f7acde75872499013befc2a3 100644 (file)
@@ -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 */
index 1c229ec82fbdbd1550e9f748336591adc45b0602..ba140bccbdb006dc206592ee1fc9d91519bc26e6 100644 (file)
@@ -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 */
index 233a21a5230b4e44f2e863acf784eea1af10b23c..0b33ab7a3a7623e943f0cd402e1023d60b0be693 100644 (file)
@@ -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"));
 
index a21fc1ba996fdba8842bc0a8e710e17eb6799296..767d99201ca9f685c84a1624a81b290eb5e5438b 100644 (file)
@@ -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;
                         }
 
index ce8efce3d533e9c25bf3a970740f402b1f0054b6..02ba5269dd65c21ba89650e4fef25d2b92a5736b 100644 (file)
@@ -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;
index 7b67337331b926ff7b85d060df77caf02e65c597..8ebd0e0e01bd807ac9e6d5ad9f946e721ef3e939 100644 (file)
@@ -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;
 }