mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 03:41:27 +00:00
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.
This commit is contained in:
parent
2ea3ce552a
commit
5b34d0dbe7
|
@ -4679,7 +4679,7 @@ static void populate(char *path, char *lastname)
|
||||||
static void notify_fifo()
|
static void notify_fifo()
|
||||||
{
|
{
|
||||||
if (fifofd == -1) {
|
if (fifofd == -1) {
|
||||||
fifofd = open(fifopath, O_WRONLY|O_NONBLOCK);
|
fifofd = open(fifopath, O_WRONLY|O_NONBLOCK|O_CLOEXEC);
|
||||||
if (fifofd == -1) {
|
if (fifofd == -1) {
|
||||||
if (errno != ENXIO)
|
if (errno != ENXIO)
|
||||||
/* Unexpected error, the FIFO file might have been removed */
|
/* Unexpected error, the FIFO file might have been removed */
|
||||||
|
|
Loading…
Reference in a new issue