mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
hurd: Cope with signals sent to ourself early
Typically when aborting during initialization, before signals are set up.
This commit is contained in:
@@ -17,7 +17,9 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <hurd.h>
|
#include <hurd.h>
|
||||||
#include <hurd/port.h>
|
#include <hurd/port.h>
|
||||||
#include <hurd/signal.h>
|
#include <hurd/signal.h>
|
||||||
@@ -34,6 +36,14 @@ __kill (pid_t pid, int sig)
|
|||||||
mach_port_t proc;
|
mach_port_t proc;
|
||||||
struct hurd_userlink ulink;
|
struct hurd_userlink ulink;
|
||||||
|
|
||||||
|
if (pid == __getpid () && _hurd_msgport == MACH_PORT_NULL)
|
||||||
|
{
|
||||||
|
/* We are trying to kill ourself but we have not even initialized our own
|
||||||
|
msgport yet. Abort by hand. */
|
||||||
|
_exit (127);
|
||||||
|
/* NOTREACHED */
|
||||||
|
}
|
||||||
|
|
||||||
void kill_pid (pid_t pid) /* Kill one PID. */
|
void kill_pid (pid_t pid) /* Kill one PID. */
|
||||||
{
|
{
|
||||||
/* SIGKILL is not delivered as a normal signal.
|
/* SIGKILL is not delivered as a normal signal.
|
||||||
|
Reference in New Issue
Block a user