Parcourir la source

Revert "Fix #225"

This reverts commit 32dde3390a.
master
Arun Prakash Jana il y a 6 ans
Parent
révision
04bd1ea71d
1 fichiers modifiés avec 9 ajouts et 20 suppressions
  1. +9
    -20
      src/nnn.c

+ 9
- 20
src/nnn.c Voir le fichier

@@ -936,15 +936,7 @@ static int join(pid_t p, uchar flag)
if (!(flag & F_NOWAIT)) { if (!(flag & F_NOWAIT)) {
/* wait for the child to exit */ /* wait for the child to exit */
do { do {
/* Exit if parent has exited */ } while (waitpid(p, &status, 0) == -1);
if (getppid() == 1) {
/* Kill child */
kill(p, SIGKILL);

/* Exit */
_exit(0);
}
} while (waitpid(p, &status, WNOHANG) <= 0);


if (WIFEXITED(status)) { if (WIFEXITED(status)) {
status = WEXITSTATUS(status); status = WEXITSTATUS(status);
@@ -1008,8 +1000,6 @@ static int spawn(char *file, char *arg1, char *arg2, const char *dir, uchar flag
exitcurses(); exitcurses();


pid = xfork(flag); pid = xfork(flag);

/* Child */
if (pid == 0) { if (pid == 0) {
if (dir && chdir(dir) == -1) if (dir && chdir(dir) == -1)
_exit(1); _exit(1);
@@ -1025,19 +1015,18 @@ static int spawn(char *file, char *arg1, char *arg2, const char *dir, uchar flag


execvp(*argv, argv); execvp(*argv, argv);
_exit(1); _exit(1);
} } else {
retstatus = join(pid, flag);


/* Parent */ DPRINTF_D(pid);
retstatus = join(pid, flag); if (flag & F_NORMAL) {
nonl();
noecho();
}


DPRINTF_D(pid); free(cmd);
if (flag & F_NORMAL) {
nonl();
noecho();
} }


free(cmd);

return retstatus; return retstatus;
} }




||||||
x
 
000:0
Chargement…
Annuler
Enregistrer