1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-29 21:55:36 +03:00

systemctl: hide some empty properties without --all

Fixes: #19423
This commit is contained in:
Frantisek Sumsal 2021-04-26 22:03:19 +02:00 committed by Yu Watanabe
parent ea1036e253
commit 1ceaad6937
2 changed files with 8 additions and 4 deletions

View File

@ -166,7 +166,8 @@ static int bus_print_property(const char *name, const char *expected_value, sd_b
if (!result)
return -EINVAL;
bus_print_property_value(name, expected_value, value, result);
if (all || !isempty(result))
bus_print_property_value(name, expected_value, value, result);
} else if (STR_IN_SET(name, "CapabilityBoundingSet", "AmbientCapabilities")) {
_cleanup_free_ char *s = NULL;
@ -175,7 +176,8 @@ static int bus_print_property(const char *name, const char *expected_value, sd_b
if (r < 0)
return r;
bus_print_property_value(name, expected_value, value, s);
if (all || !isempty(s))
bus_print_property_value(name, expected_value, value, s);
} else if ((STR_IN_SET(name, "CPUWeight", "StartupCPUWeight", "IOWeight", "StartupIOWeight") && u == CGROUP_WEIGHT_INVALID) ||
(STR_IN_SET(name, "CPUShares", "StartupCPUShares") && u == CGROUP_CPU_SHARES_INVALID) ||

View File

@ -1425,7 +1425,8 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m
if (n < 0)
return log_oom();
bus_print_property_value(name, expected_value, value, h);
if (all || !isempty(h))
bus_print_property_value(name, expected_value, value, h);
return 1;
@ -1626,7 +1627,8 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m
if (!affinity)
return log_oom();
bus_print_property_value(name, expected_value, value, affinity);
if (all || !isempty(affinity))
bus_print_property_value(name, expected_value, value, affinity);
return 1;
} else if (streq(name, "MountImages")) {