Skip to content

Commit

Permalink
SystemServer: Create /tmp/semaphore on startup
Browse files Browse the repository at this point in the history
This directory will store all LibPthread named semaphores
  • Loading branch information
IdanHo authored and awesomekling committed Jul 21, 2022
1 parent 35789f5 commit 23f3857
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Userland/Services/SystemServer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,15 @@ static ErrorOr<void> create_tmp_coredump_directory()
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)
{
bool user = false;
Expand All @@ -481,6 +490,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)

if (!user) {
TRY(create_tmp_coredump_directory());
TRY(create_tmp_semaphore_directory());
TRY(determine_system_mode());
}

Expand Down

0 comments on commit 23f3857

Please sign in to comment.