From: Yu Watanabe Date: Sat, 2 Mar 2019 14:36:51 +0000 (+0900) Subject: systemctl: do not show negative values in {Success,Failure}ActionExitStatus= X-Git-Tag: v242-rc1~203^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3ddd4571d8de6ef391704f61af4d01b93a44292;p=thirdparty%2Fsystemd.git systemctl: do not show negative values in {Success,Failure}ActionExitStatus= --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index c3030b9f1db..966218149f1 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -4669,6 +4669,23 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m switch (bus_type) { + case SD_BUS_TYPE_INT32: + if (endswith(name, "ActionExitStatus")) { + int32_t i; + + r = sd_bus_message_read_basic(m, bus_type, &i); + if (r < 0) + return r; + + if (i >= 0 && i <= 255) + bus_print_property_valuef(name, expected_value, value, "%"PRIi32, i); + else if (all) + bus_print_property_value(name, expected_value, value, "[not set]"); + + return 1; + } + break; + case SD_BUS_TYPE_STRUCT: if (contents[0] == SD_BUS_TYPE_UINT32 && streq(name, "Job")) {