From 5b34d0dbe73627f8d302fc3cb6929ce87cdd286d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Villeveygoux?= Date: Wed, 6 May 2020 01:45:21 +0200 Subject: [PATCH] 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(-) 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 */