1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:08:10 +00:00

Kernel: Convert hostname to KString

This commit is contained in:
Idan Horowitz 2022-01-13 00:27:33 +02:00 committed by Brian Gianforcaro
parent 6402840670
commit 50d6a6a186
4 changed files with 8 additions and 8 deletions

View file

@ -45,9 +45,9 @@ static Atomic<pid_t> next_pid;
static Singleton<SpinlockProtected<Process::List>> s_all_instances;
READONLY_AFTER_INIT Memory::Region* g_signal_trampoline_region;
static Singleton<MutexProtected<String>> s_hostname;
static Singleton<MutexProtected<OwnPtr<KString>>> s_hostname;
MutexProtected<String>& hostname()
MutexProtected<OwnPtr<KString>>& hostname()
{
return *s_hostname;
}
@ -73,7 +73,7 @@ UNMAP_AFTER_INIT void Process::initialize()
// Note: This is called before scheduling is initialized, and before APs are booted.
// So we can "safely" bypass the lock here.
reinterpret_cast<String&>(hostname()) = "courage";
reinterpret_cast<OwnPtr<KString>&>(hostname()) = KString::must_create("courage"sv);
create_signal_trampoline();
}