diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-07-14 03:30:42 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-21 16:39:22 +0200 |
commit | 23f3857cdd404275044be599666081e1a8a7a287 (patch) | |
tree | ecb865c7a943500a9293dc6c5dcc87b9c32475a4 | |
parent | 35789f56a511eda6b388e0ab91466677280a92c6 (diff) | |
download | serenity-23f3857cdd404275044be599666081e1a8a7a287.zip |
SystemServer: Create /tmp/semaphore on startup
This directory will store all LibPthread named semaphores
-rw-r--r-- | Userland/Services/SystemServer/main.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Services/SystemServer/main.cpp b/Userland/Services/SystemServer/main.cpp index c2ae144d76..8f78d72691 100644 --- a/Userland/Services/SystemServer/main.cpp +++ b/Userland/Services/SystemServer/main.cpp @@ -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; @@ -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()); } |