From 5b34d0dbe73627f8d302fc3cb6929ce87cdd286d Mon Sep 17 00:00:00 2001 From: Léo Villeveygoux Date: Wed, 6 May 2020 01:45:21 +0200 Subject: 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. --- src/nnn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 */ -- cgit v1.2.3-70-g09d2