diff --git a/Userland/Applications/Mail/CMakeLists.txt b/Userland/Applications/Mail/CMakeLists.txt index f70d28df8b..7e1d8f1b2a 100644 --- a/Userland/Applications/Mail/CMakeLists.txt +++ b/Userland/Applications/Mail/CMakeLists.txt @@ -16,4 +16,4 @@ set(SOURCES ) serenity_app(Mail ICON app-mail) -target_link_libraries(Mail LibConfig LibCore LibDesktop LibGfx LibGUI LibIMAP LibWeb) +target_link_libraries(Mail LibConfig LibCore LibDesktop LibGfx LibGUI LibIMAP LibWeb LibMain) diff --git a/Userland/Applications/Mail/main.cpp b/Userland/Applications/Mail/main.cpp index ba7e2b48dd..3238ab055b 100644 --- a/Userland/Applications/Mail/main.cpp +++ b/Userland/Applications/Mail/main.cpp @@ -11,44 +11,22 @@ #include #include #include -#include -#include +#include +#include -int main(int argc, char** argv) +ErrorOr serenity_main(Main::Arguments arguments) { - if (pledge("stdio recvfd sendfd rpath unix inet", nullptr) < 0) { - perror("pledge"); - return 1; - } + TRY(System::pledge("stdio recvfd sendfd rpath unix inet", nullptr)); - auto app = GUI::Application::construct(argc, argv); + auto app = GUI::Application::construct(arguments.argc, arguments.argv); Config::pledge_domains("Mail"); - if (unveil("/res", "r") < 0) { - perror("pledge"); - return 1; - } - - if (unveil("/etc", "r") < 0) { - perror("pledge"); - return 1; - } - - if (unveil("/tmp/portal/webcontent", "rw") < 0) { - perror("unveil"); - return 1; - } - - if (unveil("/tmp/portal/lookup", "rw") < 0) { - perror("unveil"); - return 1; - } - - if (unveil(nullptr, nullptr) < 0) { - perror("unveil"); - return 1; - } + TRY(System::unveil("/res", "r")); + TRY(System::unveil("/etc", "r")); + TRY(System::unveil("/tmp/portal/webcontent", "rw")); + TRY(System::unveil("/tmp/portal/lookup", "rw")); + TRY(System::unveil(nullptr, nullptr)); auto window = GUI::Window::construct();