aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Léo Villeveygoux <l@vgx.fr>2020-05-06 01:45:21 +0200
committerGravatar Léo Villeveygoux <l@vgx.fr>2020-05-06 01:45:21 +0200
commit5b34d0dbe73627f8d302fc3cb6929ce87cdd286d (patch)
treed6321a2bfce9dd0a4f058de9a419739f08e334ca /src/nnn.c
parent2ea3ce552a5cbcb74742ca0671784f19c225429e (diff)
downloadnnn-5b34d0dbe73627f8d302fc3cb6929ce87cdd286d.tar.gz
Prevent open FIFO prom leaking to subprocess
This fix previews window staying open after nnn exits, because they inherited open FIFO (in write mode) from parent nnn process, and never close it.
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 069599b..73e656c 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4679,7 +4679,7 @@ static void populate(char *path, char *lastname)
static void notify_fifo()
{
if (fifofd == -1) {
- fifofd = open(fifopath, O_WRONLY|O_NONBLOCK);
+ fifofd = open(fifopath, O_WRONLY|O_NONBLOCK|O_CLOEXEC);
if (fifofd == -1) {
if (errno != ENXIO)
/* Unexpected error, the FIFO file might have been removed */