1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:17:44 +00:00

SystemServer: Create /tmp/semaphore on startup

This directory will store all LibPthread named semaphores
This commit is contained in:
Idan Horowitz 2022-07-14 03:30:42 +03:00 committed by Andreas Kling
parent 35789f56a5
commit 23f3857cdd

View file

@ -465,6 +465,15 @@ static ErrorOr<void> create_tmp_coredump_directory()
return {}; return {};
} }
static ErrorOr<void> create_tmp_semaphore_directory()
{
dbgln("Creating /tmp/semaphore directory");
auto old_umask = umask(0);
TRY(Core::System::mkdir("/tmp/semaphore"sv, 0777));
umask(old_umask);
return {};
}
ErrorOr<int> serenity_main(Main::Arguments arguments) ErrorOr<int> serenity_main(Main::Arguments arguments)
{ {
bool user = false; bool user = false;
@ -481,6 +490,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (!user) { if (!user) {
TRY(create_tmp_coredump_directory()); TRY(create_tmp_coredump_directory());
TRY(create_tmp_semaphore_directory());
TRY(determine_system_mode()); TRY(determine_system_mode());
} }