mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:37:46 +00:00
Utilities: Fix top utility not calling exit() on SIGINT
Before, when running top, pressing Control+C (triggering SIGINT), would not call the atexit handler. Therefor not restoring stdin.
This commit is contained in:
parent
058a39c6fc
commit
a5dfd5eeb6
1 changed files with 6 additions and 3 deletions
|
@ -203,11 +203,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
TRY(Core::System::unveil("/etc/passwd", "r"));
|
TRY(Core::System::unveil("/etc/passwd", "r"));
|
||||||
unveil(nullptr, nullptr);
|
unveil(nullptr, nullptr);
|
||||||
|
|
||||||
signal(SIGWINCH, [](int) {
|
TRY(Core::System::signal(SIGWINCH, [](int) {
|
||||||
g_window_size_changed = true;
|
g_window_size_changed = true;
|
||||||
});
|
}));
|
||||||
|
TRY(Core::System::signal(SIGINT, [](int) {
|
||||||
|
exit(0);
|
||||||
|
}));
|
||||||
TRY(Core::System::pledge("stdio rpath tty"));
|
TRY(Core::System::pledge("stdio rpath tty"));
|
||||||
|
|
||||||
TopOption top_option;
|
TopOption top_option;
|
||||||
parse_args(arguments, top_option);
|
parse_args(arguments, top_option);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue