Преглед изворни кода

Properly wait for processes to terminate

master
lostd пре 10 година
родитељ
комит
955152417f
1 измењених фајлова са 10 додато и 3 уклоњено
  1. +10
    -3
      noice.c

+ 10
- 3
noice.c Прегледај датотеку

@@ -427,6 +427,7 @@ begin:
char *tmp;
regex_t re;
struct history *hist;
int status;

redraw:
nlines = MIN(LINES - 4, n);
@@ -560,10 +561,16 @@ nochange:

/* Run program */
pid = fork();
if (pid == 0)
if (pid == 0) {
execlp(bin, bin, pathnew, NULL);
else
waitpid(pid, NULL, 0);
_exit(0);
} else {
/* Ignore interruptions */
while (waitpid(pid, &status,
0) == -1)
DPRINTF_D(status);
DPRINTF_D(pid);
}

initcurses();



Loading…
Откажи
Сачувај