]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/nspawn/nspawn-stub-pid1.c
resolved: rework parsing of /etc/hosts
[thirdparty/systemd.git] / src / nspawn / nspawn-stub-pid1.c
index 0c48434db8e78ad4b9206fa24fba789411d92956..5d17df39d9c2536ebc54e7dd7dc7172d20708be8 100644 (file)
@@ -1,34 +1,19 @@
-/***
-  This file is part of systemd.
-
-  Copyright 2016 Lennart Poettering
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
+/* SPDX-License-Identifier: LGPL-2.1+ */
 
 #include <sys/reboot.h>
 #include <sys/wait.h>
 #include <sys/prctl.h>
 #include <unistd.h>
 
+#include "def.h"
+#include "exit-status.h"
 #include "fd-util.h"
 #include "log.h"
+#include "missing.h"
 #include "nspawn-stub-pid1.h"
 #include "process-util.h"
 #include "signal-util.h"
 #include "time-util.h"
-#include "def.h"
 
 static int reset_environ(const char *new_environment, size_t length) {
         unsigned long start, end;
@@ -91,7 +76,7 @@ int stub_pid1(sd_id128_t uuid) {
         sd_id128_to_string(uuid, new_environment + sizeof(new_environment) - SD_ID128_STRING_MAX);
         reset_environ(new_environment, sizeof(new_environment));
 
-        rename_process("STUBINIT");
+        (void) rename_process("(sd-stubinit)");
 
         assert_se(sigemptyset(&waitmask) >= 0);
         assert_se(sigset_add_many(&waitmask,
@@ -138,7 +123,7 @@ int stub_pid1(sd_id128_t uuid) {
                         if (si.si_pid == pid && si.si_code == CLD_EXITED)
                                 r = si.si_status; /* pass on exit code */
                         else
-                                r = 255; /* signal, coredump, timeout, … */
+                                r = EXIT_EXCEPTION; /* signal, coredump, timeout, … */
 
                         goto finish;
                 }