aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-02-01 19:28:59 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-02-01 19:28:59 +0530
commitc0f423496ea7b0d149bb64324e6590049e97d561 (patch)
treed6a642438f1a876ea5474862c5306aaf056e19e2 /src
parent4401dbe092d6f70a8f3b4c407655c11658487bc6 (diff)
downloadnnn-c0f423496ea7b0d149bb64324e6590049e97d561.tar.gz
Use _exit() to terminate children
The NNN_PIPE file gets deleted after spawning a child in NOWAIT mode. Steps: - open `nnn` with option `-x` - press `;o` (custom binding) to open fzopen plugin - press `^J` to select a file; it will spawn plugin `.cbcp` in NOWAIT mode - when the intermediate child quits, the NNN_PIPE of parent is also deleted
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nnn.c b/src/nnn.c
index a98237b..133660d 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1302,7 +1302,7 @@ static pid_t xfork(uchar flag)
p = fork();
if (p > 0)
- exit(0);
+ _exit(0);
else if (p == 0) {
signal(SIGHUP, SIG_DFL);
signal(SIGINT, SIG_DFL);
@@ -1314,7 +1314,7 @@ static pid_t xfork(uchar flag)
}
perror("fork");
- exit(0);
+ _exit(0);
}
/* so they can be used to stop the child */