main.cpp 778 B

123456789101112131415161718192021222324
  1. /*
  2. * Copyright (c) 2021, timmot <tiwwot@protonmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <FileSystemAccessServer/ClientConnection.h>
  7. #include <LibCore/LocalServer.h>
  8. #include <LibCore/System.h>
  9. #include <LibGUI/Application.h>
  10. #include <LibIPC/ClientConnection.h>
  11. #include <LibMain/Main.h>
  12. ErrorOr<int> serenity_main(Main::Arguments)
  13. {
  14. TRY(Core::System::pledge("stdio recvfd sendfd rpath cpath wpath unix thread", nullptr));
  15. auto app = GUI::Application::construct(0, nullptr);
  16. app->set_quit_when_last_window_deleted(false);
  17. auto socket = Core::LocalSocket::take_over_accepted_socket_from_system_server();
  18. IPC::new_client_connection<FileSystemAccessServer::ClientConnection>(socket.release_nonnull(), 1);
  19. return app->exec();
  20. }