]> 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)
committerMike Yuan <me@yhndnzj.com>
Sat, 8 Mar 2025 19:40:24 +0000 (20:40 +0100)
If it fails, we'd submit the errno to supervisor via sd_notify() later.

src/core/main.c

index 15e29bbcbabca1735c04bd1bc31b6a06ba1017b9..6b9b9eb691564bdbe14edc8032f6aac3278dd58d 100644 (file)
@@ -3136,7 +3136,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;
                         }
@@ -3212,7 +3213,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;
                 }