summaryrefslogtreecommitdiffstats
path: root/src/basic/psi-util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-08-09 17:03:15 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-08-16 12:52:56 +0200
commitbb44fd073402cdfdbf2dfee549708a93c7c73aaf (patch)
tree802e8c24a376d24c86c0b89b4aec5cc227177881 /src/basic/psi-util.c
parentlibsystemd-network: use _NEG_ macros to reduce indentation (diff)
downloadsystemd-bb44fd073402cdfdbf2dfee549708a93c7c73aaf.tar.xz
systemd-bb44fd073402cdfdbf2dfee549708a93c7c73aaf.zip
various: use _NEG_ macros to reduce indentation
No functional change intended.
Diffstat (limited to 'src/basic/psi-util.c')
-rw-r--r--src/basic/psi-util.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/basic/psi-util.c b/src/basic/psi-util.c
index af8e278bd0..2a43b03d97 100644
--- a/src/basic/psi-util.c
+++ b/src/basic/psi-util.c
@@ -118,12 +118,10 @@ int is_pressure_supported(void) {
FOREACH_STRING(p, "/proc/pressure/cpu", "/proc/pressure/io", "/proc/pressure/memory") {
r = read_virtual_file(p, 0, NULL, NULL);
- if (r < 0) {
- if (r == -ENOENT || ERRNO_IS_NOT_SUPPORTED(r))
- return (cached = false);
-
+ if (r == -ENOENT || ERRNO_IS_NEG_NOT_SUPPORTED(r))
+ return (cached = false);
+ if (r < 0)
return r;
- }
}
return (cached = true);