From df387aae5c3d2e77b74559fb48f2a43c183e9bee Mon Sep 17 00:00:00 2001 From: Carson Fleming Date: Tue, 20 Oct 2020 23:57:27 +0200 Subject: Switched from system to execv(sh -c) to prevent extra process --- daemonize.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'daemonize.c') diff --git a/daemonize.c b/daemonize.c index 635ce2b..7b9daac 100644 --- a/daemonize.c +++ b/daemonize.c @@ -124,5 +124,7 @@ int main (int argc, char** argv) { } daemon(options.nochdir, options.noclose | logs); - system(buffer); + + char* args[] = {"/bin/sh", "-c", buffer, NULL}; + execv(args[0], args); } -- cgit v1.2.3