]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/main: assign mac_init() retval to r
authorMike Yuan <me@yhndnzj.com>
Wed, 5 Mar 2025 17:22:19 +0000 (18:22 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 22 Mar 2025 15:51:44 +0000 (15:51 +0000)
If it fails, we'd submit the errno to supervisor via sd_notify() later.

(cherry picked from commit 550f4718bc6b11d8801af3b7eb888aa4ba0fdc90)

src/core/main.c

index 74dab2e62b28c862c47f59f28f43ffe4fff31f07..7d2b3a1ce690b9ec53cc9aa7ded6443b5a40de03 100644 (file)
@@ -3131,7 +3131,8 @@ int main(int argc, char *argv[]) {
                                         goto finish;
                         }
 
-                        if (mac_init() < 0) {
+                        r = mac_init();
+                        if (r < 0) {
                                 error_message = "Failed to initialize MAC support";
                                 goto finish;
                         }
@@ -3211,7 +3212,8 @@ int main(int argc, char *argv[]) {
                 /* clear the kernel timestamp, because we are not PID 1 */
                 kernel_timestamp = DUAL_TIMESTAMP_NULL;
 
-                if (mac_init() < 0) {
+                r = mac_init();
+                if (r < 0) {
                         error_message = "Failed to initialize MAC support";
                         goto finish;
                 }