mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-13 04:52:23 +00:00
SystemServer: Create /tmp/semaphore on startup
This directory will store all LibPthread named semaphores
This commit is contained in:
parent
35789f56a5
commit
23f3857cdd
Notes:
sideshowbarker
2024-07-17 17:49:11 +09:00
Author: https://github.com/IdanHo
Commit: 23f3857cdd
Pull-request: https://github.com/SerenityOS/serenity/pull/14578
1 changed files with 10 additions and 0 deletions
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue