From: Léo Villeveygoux Date: Tue, 5 May 2020 23:45:21 +0000 (+0200) Subject: Prevent open FIFO prom leaking to subprocess X-Git-Tag: v3.2~55 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=5b34d0dbe73627f8d302fc3cb6929ce87cdd286d;p=nnn.git 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. --- diff --git a/src/nnn.c b/src/nnn.c index 069599b3..73e656ce 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 */