Commit c957d3ef authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Lasse Karstensen

Don't close stdout/stderr when we stop due to EOF on stdin in -d mode.

That obscured problems in cleanup
parent 5f9cf70f
......@@ -355,12 +355,6 @@ cli_stdin_close(void *priv)
{
(void)priv;
(void)close(0);
(void)close(1);
(void)close(2);
AZ(open("/dev/null", O_RDONLY));
assert(open("/dev/null", O_WRONLY) == 1);
assert(open("/dev/null", O_WRONLY) == 2);
if (d_flag) {
mgt_stop_child();
......@@ -368,6 +362,13 @@ cli_stdin_close(void *priv)
if (pfh != NULL)
(void)VPF_Remove(pfh);
exit(0);
} else {
(void)close(0);
(void)close(1);
(void)close(2);
AZ(open("/dev/null", O_RDONLY));
assert(open("/dev/null", O_WRONLY) == 1);
assert(open("/dev/null", O_WRONLY) == 2);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment