mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03: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
Notes:
sideshowbarker
2024-07-19 17:00:01 +09:00
Author: https://github.com/Gargafield Commit: https://github.com/SerenityOS/serenity/commit/a5dfd5eeb62 Pull-request: https://github.com/SerenityOS/serenity/pull/16683 Reviewed-by: https://github.com/MacDue Reviewed-by: https://github.com/trflynn89
@ -203,11 +203,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
TRY(Core::System::unveil("/etc/passwd", "r"));
|
||||
unveil(nullptr, nullptr);
|
||||
|
||||
signal(SIGWINCH, [](int) {
|
||||
TRY(Core::System::signal(SIGWINCH, [](int) {
|
||||
g_window_size_changed = true;
|
||||
});
|
||||
|
||||
}));
|
||||
TRY(Core::System::signal(SIGINT, [](int) {
|
||||
exit(0);
|
||||
}));
|
||||
TRY(Core::System::pledge("stdio rpath tty"));
|
||||
|
||||
TopOption top_option;
|
||||
parse_args(arguments, top_option);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user