mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Properly wait for processes to terminate
This commit is contained in:
parent
3f95571b38
commit
955152417f
13
noice.c
13
noice.c
|
@ -427,6 +427,7 @@ begin:
|
||||||
char *tmp;
|
char *tmp;
|
||||||
regex_t re;
|
regex_t re;
|
||||||
struct history *hist;
|
struct history *hist;
|
||||||
|
int status;
|
||||||
|
|
||||||
redraw:
|
redraw:
|
||||||
nlines = MIN(LINES - 4, n);
|
nlines = MIN(LINES - 4, n);
|
||||||
|
@ -560,10 +561,16 @@ nochange:
|
||||||
|
|
||||||
/* Run program */
|
/* Run program */
|
||||||
pid = fork();
|
pid = fork();
|
||||||
if (pid == 0)
|
if (pid == 0) {
|
||||||
execlp(bin, bin, pathnew, NULL);
|
execlp(bin, bin, pathnew, NULL);
|
||||||
else
|
_exit(0);
|
||||||
waitpid(pid, NULL, 0);
|
} else {
|
||||||
|
/* Ignore interruptions */
|
||||||
|
while (waitpid(pid, &status,
|
||||||
|
0) == -1)
|
||||||
|
DPRINTF_D(status);
|
||||||
|
DPRINTF_D(pid);
|
||||||
|
}
|
||||||
|
|
||||||
initcurses();
|
initcurses();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue