mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
InspectorServer: Port to LibMain :^)
This commit is contained in:
parent
fe00393941
commit
6e2f7a15fb
2 changed files with 7 additions and 8 deletions
|
@ -16,4 +16,4 @@ set(SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
serenity_bin(InspectorServer)
|
serenity_bin(InspectorServer)
|
||||||
target_link_libraries(InspectorServer LibIPC)
|
target_link_libraries(InspectorServer LibIPC LibMain)
|
||||||
|
|
|
@ -8,17 +8,16 @@
|
||||||
#include <InspectorServer/ClientConnection.h>
|
#include <InspectorServer/ClientConnection.h>
|
||||||
#include <LibCore/EventLoop.h>
|
#include <LibCore/EventLoop.h>
|
||||||
#include <LibCore/LocalServer.h>
|
#include <LibCore/LocalServer.h>
|
||||||
|
#include <LibCore/System.h>
|
||||||
#include <LibIPC/ClientConnection.h>
|
#include <LibIPC/ClientConnection.h>
|
||||||
|
#include <LibMain/Main.h>
|
||||||
|
|
||||||
int main(int, char**)
|
ErrorOr<int> serenity_main(Main::Arguments)
|
||||||
{
|
{
|
||||||
Core::EventLoop event_loop;
|
Core::EventLoop event_loop;
|
||||||
auto server = Core::LocalServer::construct();
|
auto server = TRY(Core::LocalServer::try_create());
|
||||||
|
|
||||||
if (pledge("stdio unix accept", nullptr) < 0) {
|
TRY(Core::System::pledge("stdio unix accept"));
|
||||||
perror("pledge");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ok = server->take_over_from_system_server("/tmp/portal/inspector");
|
bool ok = server->take_over_from_system_server("/tmp/portal/inspector");
|
||||||
VERIFY(ok);
|
VERIFY(ok);
|
||||||
|
@ -28,7 +27,7 @@ int main(int, char**)
|
||||||
IPC::new_client_connection<InspectorServer::ClientConnection>(move(client_socket), client_id);
|
IPC::new_client_connection<InspectorServer::ClientConnection>(move(client_socket), client_id);
|
||||||
};
|
};
|
||||||
|
|
||||||
auto inspectables_server = Core::LocalServer::construct();
|
auto inspectables_server = TRY(Core::LocalServer::try_create());
|
||||||
if (!inspectables_server->take_over_from_system_server("/tmp/portal/inspectables"))
|
if (!inspectables_server->take_over_from_system_server("/tmp/portal/inspectables"))
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue