From: Mike Yuan Date: Fri, 12 Jan 2024 09:35:21 +0000 (+0800) Subject: run: don't show IP/IO accounting data if 0 X-Git-Tag: v256-rc1~1165^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F30902%2Fhead;p=thirdparty%2Fsystemd.git run: don't show IP/IO accounting data if 0 --- diff --git a/src/run/run.c b/src/run/run.c index e94ae2abbe6..3f54bd5607d 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -1835,9 +1835,9 @@ static int start_transient_service(sd_bus *bus) { const char *ip_ingress = NULL, *ip_egress = NULL; - if (c.ip_ingress_bytes != UINT64_MAX) + if (!IN_SET(c.ip_ingress_bytes, 0, UINT64_MAX)) ip_ingress = strjoina(" received: ", FORMAT_BYTES(c.ip_ingress_bytes)); - if (c.ip_egress_bytes != UINT64_MAX) + if (!IN_SET(c.ip_egress_bytes, 0, UINT64_MAX)) ip_egress = strjoina(" sent: ", FORMAT_BYTES(c.ip_egress_bytes)); if (ip_ingress || ip_egress) @@ -1845,9 +1845,9 @@ static int start_transient_service(sd_bus *bus) { const char *io_read = NULL, *io_write = NULL; - if (c.io_read_bytes != UINT64_MAX) + if (!IN_SET(c.io_read_bytes, 0, UINT64_MAX)) io_read = strjoina(" read: %s", FORMAT_BYTES(c.io_read_bytes)); - if (c.io_write_bytes != UINT64_MAX) + if (!IN_SET(c.io_write_bytes, 0, UINT64_MAX)) io_write = strjoina(" written: %s", FORMAT_BYTES(c.io_write_bytes)); if (io_read || io_write)