]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: do not show negative values in {Success,Failure}ActionExitStatus=
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 2 Mar 2019 14:36:51 +0000 (23:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 4 Mar 2019 14:35:56 +0000 (23:35 +0900)
src/systemctl/systemctl.c

index c3030b9f1db647d409059bcf8efae36e8b42b4d0..966218149f1a48d83e98e22d48e1521b4e2b12e1 100644 (file)
@@ -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")) {