]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: do print all statuses/signals received from pid1
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 28 Jul 2019 11:47:39 +0000 (13:47 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 29 Jul 2019 13:54:53 +0000 (15:54 +0200)
If for some reason we do not know some signal, instead of silently
skipping it, let's print it numerically. Likewise, 'show' is not the
right place to do value filtering for exit codes. If pid1 accepted it,
let's just print it with no fuss.

src/systemctl/systemctl.c

index 9e8095c8b780d1b7a6c2d224690cffc1d2fb399a..880a04411c11e98a84ad0d0e15d95f19086fb392 100644 (file)
@@ -4941,9 +4941,6 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m
                                 }
 
                                 for (i = 0; i < n_status; i++) {
-                                        if (status[i] < 0 || status[i] > 255)
-                                                continue;
-
                                         if (first)
                                                 first = false;
                                         else
@@ -4956,15 +4953,16 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m
                                         const char *str;
 
                                         str = signal_to_string((int) signal[i]);
-                                        if (!str)
-                                                continue;
 
                                         if (first)
                                                 first = false;
                                         else
                                                 fputc(' ', stdout);
 
-                                        fputs(str, stdout);
+                                        if (str)
+                                                fputs(str, stdout);
+                                        else
+                                                printf("%"PRIi32, status[i]);
                                 }
 
                                 fputc('\n', stdout);