X Tutup
Skip to content

Commit 148ffa2

Browse files
committed
systemctl: do print all statuses/signals received from pid1
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.
1 parent e7b9f4d commit 148ffa2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/systemctl/systemctl.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4941,9 +4941,6 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m
49414941
}
49424942

49434943
for (i = 0; i < n_status; i++) {
4944-
if (status[i] < 0 || status[i] > 255)
4945-
continue;
4946-
49474944
if (first)
49484945
first = false;
49494946
else
@@ -4956,15 +4953,16 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m
49564953
const char *str;
49574954

49584955
str = signal_to_string((int) signal[i]);
4959-
if (!str)
4960-
continue;
49614956

49624957
if (first)
49634958
first = false;
49644959
else
49654960
fputc(' ', stdout);
49664961

4967-
fputs(str, stdout);
4962+
if (str)
4963+
fputs(str, stdout);
4964+
else
4965+
printf("%"PRIi32, status[i]);
49684966
}
49694967

49704968
fputc('\n', stdout);

0 commit comments

Comments
 (0)
X Tutup