Simplify shutdown in container, call _exit()

Calling _exit(2) lets libc do most of the cleanup we want when shutting
down while in a container.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2022-03-24 21:56:47 +01:00
1 parent 094e00d405
commit 2002157032
2 files changed
+8 -7

No files matched your search

+1 -1
View File
@@ -260,7 +260,6 @@ int run_interactive(char *cmd, char *fmt, ...)
int exec_runtask(char *cmd, char *args[])
{
size_t i;
char buf[1024] = "";
char *argv[4] = {
"sh",
@@ -268,6 +267,7 @@ int exec_runtask(char *cmd, char *args[])
buf,
NULL
};
size_t i;
strlcat(buf, cmd, sizeof(buf));
for (i = 1; args[i]; i++) {