fix?: close stdin and stdout at the end of child process
This commit is contained in:
parent
0c150e1f9d
commit
5f3abb14e8
|
@ -359,6 +359,8 @@ int jobs_run(PIPELINE *pline) {
|
||||||
}
|
}
|
||||||
free(args);
|
free(args);
|
||||||
int exit_code = errno;
|
int exit_code = errno;
|
||||||
|
close(STDIN_FILENO);
|
||||||
|
close(STDOUT_FILENO);
|
||||||
exit(exit_code);
|
exit(exit_code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -385,6 +387,8 @@ int jobs_run(PIPELINE *pline) {
|
||||||
if (WIFEXITED(status))
|
if (WIFEXITED(status))
|
||||||
exit_code = WEXITSTATUS(status);
|
exit_code = WEXITSTATUS(status);
|
||||||
}
|
}
|
||||||
|
close(STDIN_FILENO);
|
||||||
|
close(STDOUT_FILENO);
|
||||||
exit(exit_code);
|
exit(exit_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user