]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: simplify skip_seccomp_unavailable() a bit
authorLennart Poettering <lennart@poettering.net>
Fri, 21 Oct 2016 18:03:51 +0000 (20:03 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 24 Oct 2016 15:29:51 +0000 (17:29 +0200)
Let's prefer early-exit over deep-indented if blocks. Not behavioural change.

src/core/execute.c

index 53356c3c06bd0f8b47aa1cbabdf31d35b7086a12..b69297241ba987acafe12138d0d6726cf34f9841 100644 (file)
@@ -1185,13 +1185,14 @@ static void rename_process_from_path(const char *path) {
 #ifdef HAVE_SECCOMP
 
 static bool skip_seccomp_unavailable(const Unit* u, const char* msg) {
-        if (!is_seccomp_available()) {
-                log_open();
-                log_unit_debug(u, "SECCOMP features not detected in the kernel, skipping %s", msg);
-                log_close();
-                return true;
-        }
-        return false;
+
+        if (is_seccomp_available())
+                return false;
+
+        log_open();
+        log_unit_debug(u, "SECCOMP features not detected in the kernel, skipping %s", msg);
+        log_close();
+        return true;
 }
 
 static int apply_seccomp(const Unit* u, const ExecContext *c) {