Skip to content

Commit

Permalink
Prevent open FIFO prom leaking to subprocess
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
leovilok committed May 5, 2020
1 parent 2ea3ce5 commit 5b34d0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nnn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 5b34d0d

Please sign in to comment.