main.cpp 774 B

1234567891011121314151617181920212223242526
  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/EventLoop.h>
  8. #include <LibCore/LocalServer.h>
  9. #include <LibGUI/Application.h>
  10. #include <LibIPC/ClientConnection.h>
  11. int main(int, char**)
  12. {
  13. if (pledge("stdio recvfd sendfd rpath cpath wpath unix thread", nullptr) < 0) {
  14. perror("pledge");
  15. return 1;
  16. }
  17. auto app = GUI::Application::construct(0, nullptr);
  18. app->set_quit_when_last_window_deleted(false);
  19. auto socket = Core::LocalSocket::take_over_accepted_socket_from_system_server();
  20. IPC::new_client_connection<FileSystemAccessServer::ClientConnection>(socket.release_nonnull(), 1);
  21. return app->exec();
  22. }