mirror of git://sourceware.org/git/glibc.git
hurd: Cope with signals sent to ourself early
Typically when aborting during initialization, before signals are set up.
This commit is contained in:
parent
0b6ad02b33
commit
0c48562508
|
@ -17,7 +17,9 @@
|
|||
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <hurd.h>
|
||||
#include <hurd/port.h>
|
||||
#include <hurd/signal.h>
|
||||
|
@ -34,6 +36,14 @@ __kill (pid_t pid, int sig)
|
|||
mach_port_t proc;
|
||||
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. */
|
||||
{
|
||||
/* SIGKILL is not delivered as a normal signal.
|
||||
|
|
Loading…
Reference in New Issue