diff options
Diffstat (limited to 'Userland/Services/KeyboardPreferenceLoader/main.cpp')
-rw-r--r-- | Userland/Services/KeyboardPreferenceLoader/main.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Userland/Services/KeyboardPreferenceLoader/main.cpp b/Userland/Services/KeyboardPreferenceLoader/main.cpp index 6fac3009fc..5eb3eb46bb 100644 --- a/Userland/Services/KeyboardPreferenceLoader/main.cpp +++ b/Userland/Services/KeyboardPreferenceLoader/main.cpp @@ -6,6 +6,7 @@ #include <LibCore/ConfigFile.h> #include <LibCore/DeprecatedFile.h> +#include <LibCore/Process.h> #include <LibCore/System.h> #include <LibMain/Main.h> #include <errno.h> @@ -30,12 +31,7 @@ ErrorOr<int> serenity_main(Main::Arguments) if (keymaps_vector.size() == 0) exit(1); - pid_t child_pid; - char const* argv[] = { "/bin/keymap", "-m", keymaps_vector.first().characters(), nullptr }; - if ((errno = posix_spawn(&child_pid, "/bin/keymap", nullptr, nullptr, const_cast<char**>(argv), environ))) { - perror("posix_spawn"); - exit(1); - } + TRY(Core::Process::spawn("/bin/keymap"sv, Array { "-m", keymaps_vector.first().characters() }, {}, Core::Process::KeepAsChild::Yes)); bool enable_num_lock = keyboard_settings_config->read_bool_entry("StartupEnable", "NumLock", true); auto keyboard_device = TRY(Core::DeprecatedFile::open("/dev/input/keyboard/0", Core::OpenMode::ReadOnly)); |