From: Lennart Poettering Date: Mon, 10 Mar 2025 10:37:03 +0000 (+0100) Subject: vmspawn: properly exit in vmspawn child on failure X-Git-Tag: v258-rc1~1125^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d4f38732b705947e704b984419306734017da3e;p=thirdparty%2Fsystemd.git vmspawn: properly exit in vmspawn child on failure --- diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index 8cae37b07bf..d8b06b7ca6e 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -2265,14 +2265,19 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) { return r; if (r == 0) { /* set TERM and LANG if they are missing */ - if (setenv("TERM", "vt220", 0) < 0) - return log_oom(); + if (setenv("TERM", "vt220", 0) < 0) { + log_oom(); + goto fail; + } - if (setenv("LANG", "C.UTF-8", 0) < 0) - return log_oom(); + if (setenv("LANG", "C.UTF-8", 0) < 0) { + log_oom(); + goto fail; + } execv(qemu_binary, cmdline); log_error_errno(errno, "Failed to execve %s: %m", qemu_binary); + fail: _exit(EXIT_FAILURE); }