Compare commits
2 Commits
4cc8a44ec7
...
e7d361ca51
Author | SHA1 | Date | |
---|---|---|---|
e7d361ca51 | |||
bb6759986e |
@ -136,6 +136,7 @@ namespace os
|
|||||||
~LocalServer();
|
~LocalServer();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
StringView m_path;
|
||||||
int m_fd;
|
int m_fd;
|
||||||
bool m_blocking;
|
bool m_blocking;
|
||||||
};
|
};
|
||||||
|
@ -43,6 +43,7 @@ namespace os
|
|||||||
fcntl(sockfd, F_SETFD, FD_CLOEXEC);
|
fcntl(sockfd, F_SETFD, FD_CLOEXEC);
|
||||||
|
|
||||||
server->m_fd = sockfd;
|
server->m_fd = sockfd;
|
||||||
|
server->m_path = path;
|
||||||
return server;
|
return server;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,6 +64,7 @@ namespace os
|
|||||||
LocalServer::~LocalServer()
|
LocalServer::~LocalServer()
|
||||||
{
|
{
|
||||||
close(m_fd);
|
close(m_fd);
|
||||||
|
os::FileSystem::remove(m_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalServer::Client::Client(Client&& other) : m_fd(other.m_fd)
|
LocalServer::Client::Client(Client&& other) : m_fd(other.m_fd)
|
||||||
|
@ -95,6 +95,8 @@ Result<int> luna_main(int argc, char** argv)
|
|||||||
setsid();
|
setsid();
|
||||||
|
|
||||||
// First of all, start the display server, in case we haven't been started by loginui.
|
// First of all, start the display server, in case we haven't been started by loginui.
|
||||||
|
// FIXME: What if we're started after a wind process has previously run but exited, so we think there's a wind
|
||||||
|
// process when there isn't.
|
||||||
if (!os::FileSystem::exists("/tmp/wind.sock"))
|
if (!os::FileSystem::exists("/tmp/wind.sock"))
|
||||||
{
|
{
|
||||||
// We need to wait for this one, since its sockets are required later.
|
// We need to wait for this one, since its sockets are required later.
|
||||||
@ -121,6 +123,7 @@ Result<int> luna_main(int argc, char** argv)
|
|||||||
// We also need to wait for this one, since taskbar requires launch.sock.
|
// We also need to wait for this one, since taskbar requires launch.sock.
|
||||||
bool success = os::IPC::Notifier::run_and_wait(
|
bool success = os::IPC::Notifier::run_and_wait(
|
||||||
[&] {
|
[&] {
|
||||||
|
(void)os::FileSystem::remove("/tmp/launch.sock");
|
||||||
StringView launch_command[] = { "/usr/bin/launch" };
|
StringView launch_command[] = { "/usr/bin/launch" };
|
||||||
spawn_process_as_user(Slice<StringView>(launch_command, 1), pw->pw_uid, pw->pw_gid, groups.slice());
|
spawn_process_as_user(Slice<StringView>(launch_command, 1), pw->pw_uid, pw->pw_gid, groups.slice());
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user