From 780bd91d1cce3dcdb8ba6c6f5cd2d20df6144586 Mon Sep 17 00:00:00 2001 From: "Thomas A." Date: Sun, 21 Jan 2024 11:53:20 -0800 Subject: [PATCH] Grab The Current PID To Abort On Setting the pid to 0 will send the SIGABRT signal to "every process in the process group of the calling process". This means that darlingserver will also get killed as a result (which we don't want to happen). --- darling/src/libsystem_kernel/emulation/linux/simple.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/darling/src/libsystem_kernel/emulation/linux/simple.c b/darling/src/libsystem_kernel/emulation/linux/simple.c index 989c941..b180ac0 100644 --- a/darling/src/libsystem_kernel/emulation/linux/simple.c +++ b/darling/src/libsystem_kernel/emulation/linux/simple.c @@ -5,6 +5,7 @@ #include #include "mach/lkm.h" #include "signal/kill.h" +#include "unistd/getpid.h" #include #include @@ -574,6 +575,6 @@ have_nl: __attribute__ ((visibility ("default"))) void __simple_abort(void) { - sys_kill(0, SIGABRT, 1); + sys_kill(sys_getpid(), SIGABRT, 1); __builtin_unreachable(); };