From 67f352b82432365402deec68e6a9644effe355b2 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Wed, 29 Jun 2022 20:20:13 +0200 Subject: [PATCH] Kernel: Copy signal handlers when forking --- Kernel/Process.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index e709323821..1e911cf3b3 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -273,6 +273,12 @@ ErrorOr Process::attach_resources(NonnullOwnPtr&& pr auto weak_ptr = TRY(this->try_make_weak_ptr()); m_procfs_traits = TRY(ProcessProcFSTraits::try_create({}, move(weak_ptr))); + + // This is not actually explicitly verified by any official documentation, + // but it's not listed anywhere as being cleared, and rsync expects it to work like this. + if (fork_parent) + m_signal_action_data = fork_parent->m_signal_action_data; + return {}; }