diff --git a/Userland/Services/SQLServer/CMakeLists.txt b/Userland/Services/SQLServer/CMakeLists.txt index 940de361e6..87e3d0fcd7 100644 --- a/Userland/Services/SQLServer/CMakeLists.txt +++ b/Userland/Services/SQLServer/CMakeLists.txt @@ -17,4 +17,4 @@ set(SOURCES ) serenity_bin(SQLServer) -target_link_libraries(SQLServer LibCore LibIPC LibSQL) +target_link_libraries(SQLServer LibCore LibIPC LibSQL LibMain) diff --git a/Userland/Services/SQLServer/main.cpp b/Userland/Services/SQLServer/main.cpp index df3b03a287..cb387f13eb 100644 --- a/Userland/Services/SQLServer/main.cpp +++ b/Userland/Services/SQLServer/main.cpp @@ -6,34 +6,26 @@ #include #include +#include +#include #include #include #include -#include -int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) +ErrorOr serenity_main(Main::Arguments) { - if (pledge("stdio accept unix rpath wpath cpath", nullptr) < 0) { - perror("pledge"); - return 1; - } + TRY(Core::System::pledge("stdio accept unix rpath wpath cpath")); if (mkdir("/home/anon/sql", 0700) < 0 && errno != EEXIST) { perror("mkdir"); return 1; } - if (unveil("/home/anon/sql", "rwc") < 0) { - perror("unveil"); - return 1; - } - if (unveil(nullptr, nullptr) < 0) { - perror("unveil"); - return 1; - } + TRY(Core::System::unveil("/home/anon/sql", "rwc")); + TRY(Core::System::unveil(nullptr, nullptr)); Core::EventLoop event_loop; - auto server = Core::LocalServer::construct(); + auto server = TRY(Core::LocalServer::try_create()); bool ok = server->take_over_from_system_server(); VERIFY(ok);