externalpipe - setsid after fork

This commit is contained in:
Ashish Kumar Yadav 2021-08-10 15:36:53 +05:30
parent 4ba3980f7d
commit f29d1b2138

View file

@ -800,7 +800,7 @@ externalpipe(const Arg *arg)
if (iofd != -1 && iofd != 1)
close(iofd);
close(cmdfd);
setsid();
close(fd[1]);
if (fd[0] != STDIN_FILENO) {
if (dup2(fd[0], STDIN_FILENO) != STDIN_FILENO)