mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-26 15:00:06 +00:00
Thu Mar 28 14:22:51 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* sysdeps/mach/hurd/kill.c: If proc_pid2task gives us MACH_PORT_NULL the process is a zombie; send no messages and return success.
This commit is contained in:
parent
43efc10333
commit
8c1442d02f
@ -1,3 +1,8 @@
|
||||
Thu Mar 28 14:22:51 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
||||
|
||||
* sysdeps/mach/hurd/kill.c: If proc_pid2task gives us MACH_PORT_NULL
|
||||
the process is a zombie; send no messages and return success.
|
||||
|
||||
Thu Mar 28 11:53:26 1996 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
|
||||
|
||||
* wctype/cname-lookup.h: Find localeinfo.h in ../locale.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -50,7 +50,8 @@ __kill (pid_t pid, int sig)
|
||||
{
|
||||
task_t refport;
|
||||
err = __proc_pid2task (proc, pid, &refport);
|
||||
if (!err)
|
||||
/* Ignore zombies. */
|
||||
if (!err && refport != MACH_PORT_NULL)
|
||||
{
|
||||
err = __task_terminate (refport);
|
||||
__mach_port_deallocate (__mach_task_self (), refport);
|
||||
@ -73,6 +74,12 @@ __kill (pid_t pid, int sig)
|
||||
/* If we could not get the task port, we can do nothing. */
|
||||
return taskerr;
|
||||
|
||||
if (refport == MACH_PORT_NULL)
|
||||
/* proc_pid2task returned success with a null task port.
|
||||
That means the process is a zombie. Signals
|
||||
to zombies should return success and do nothing. */
|
||||
return 0;
|
||||
|
||||
/* For user convenience in the case of a task that has
|
||||
not registered any message port with the proc server,
|
||||
translate a few signals to direct task operations. */
|
||||
@ -85,6 +92,7 @@ __kill (pid_t pid, int sig)
|
||||
return __task_suspend (refport);
|
||||
case SIGCONT:
|
||||
return __task_resume (refport);
|
||||
case SIGTERM:
|
||||
case SIGQUIT:
|
||||
case SIGINT:
|
||||
return __task_terminate (refport);
|
||||
|
Loading…
Reference in New Issue
Block a user