commit 5b34d0dbe73627f8d302fc3cb6929ce87cdd286d
parent 2ea3ce552a5cbcb74742ca0671784f19c225429e
Author: Léo Villeveygoux <l@vgx.fr>
Date: Wed, 6 May 2020 01:45:21 +0200
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:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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 */