Exit if parent has exited (#16)

This commit is contained in:
aaeilm 2017-04-25 15:12:07 -04:00 committed by Arun Prakash Jana
parent 0fd6a392db
commit 92236abf31

3
nnn.c
View file

@ -1295,6 +1295,9 @@ begin:
for (;;) { for (;;) {
redraw(path); redraw(path);
nochange: nochange:
/* Exit if parent has exited */
if (getppid() == 1)
_exit(0);
sel = nextsel(&run, &env); sel = nextsel(&run, &env);
switch (sel) { switch (sel) {
case SEL_CDQUIT: case SEL_CDQUIT: