diff options
| author | Carson Fleming <cflems@cflems.net> | 2020-10-20 23:57:27 +0200 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2020-10-20 23:57:27 +0200 |
| commit | df387aae5c3d2e77b74559fb48f2a43c183e9bee (patch) | |
| tree | 8edd699a3dfdcd8c3f3a1c28ab90e80bc23ea63f /daemonize.c | |
| parent | d1d12387664b71aa03e5bc3b87ff0083f86e000e (diff) | |
| download | daemonize-df387aae5c3d2e77b74559fb48f2a43c183e9bee.tar.gz | |
Switched from system to execv(sh -c) to prevent extra process
Diffstat (limited to 'daemonize.c')
| -rw-r--r-- | daemonize.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); } |
