mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
kill: Port to LibMain
This commit is contained in:
parent
c23d25d1de
commit
500098c76d
Notes:
sideshowbarker
2024-07-17 18:58:13 +09:00
Author: https://github.com/itskarudo 🔰
Commit: 500098c76d
Pull-request: https://github.com/SerenityOS/serenity/pull/12451
Reviewed-by: https://github.com/kleinesfilmroellchen
Reviewed-by: https://github.com/timschumi
Reviewed-by: https://github.com/trflynn89
2 changed files with 9 additions and 5 deletions
|
@ -6,6 +6,8 @@
|
|||
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibMain/Main.h>
|
||||
#include <ctype.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
|
@ -19,12 +21,13 @@ static void print_usage_and_exit()
|
|||
exit(1);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
if (pledge("stdio proc", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
TRY(Core::System::pledge("stdio proc"));
|
||||
|
||||
int argc = arguments.argc;
|
||||
char** argv = arguments.argv;
|
||||
|
||||
if (argc == 2 && !strcmp(argv[1], "-l")) {
|
||||
for (size_t i = 0; i < NSIG; ++i) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue