Noux: close stdio at exit

Close the stdin, stdout, and stderr I/O channels at child exit. This
serves to flush buffers at the I/O resources which might not be written
otherwise.

Ref #2919
This commit is contained in:
Emery Hemingway 2018-09-10 17:20:59 +02:00 committed by Christian Helmuth
parent 7e7cb15bd1
commit 86ee1b7448

View File

@ -278,9 +278,13 @@ struct Noux::Main
_destruct_queue.flush();
/* let noux exit if the init process exited */
if (!init_child)
if (!init_child) {
_channel_0 = Shared_pointer<Io_channel>();
_channel_1 = Shared_pointer<Io_channel>();
_channel_2 = Shared_pointer<Io_channel>();
_env.parent().exit(exit_value);
}
}
struct Kill_broadcaster_impl: Kill_broadcaster
{