home *** CD-ROM | disk | FTP | other *** search
- static char rcsid[] = "@(#)$Id: killit.c,v 2.0 07/18/90 jbc $";
- /***************************************************************************/
- /* Copyright (c) 1990 James B. Cummings, Jr. */
- /* */
- /* This program is offered in the Public Domain and is freely available */
- /* as long as this notice is kept intact with each module. */
- /***************************************************************************/
- #include "header.h"
-
- killit(pid)
- int pid;
- {
- kill(pid, SIGHUP); /* first send "hangup" signal */
- sleep(KWAIT);
-
- if (!kill(pid,0)) { /* SIGHUP might be ignored */
- kill(pid, SIGKILL); /* should do the trick */
- sleep(KWAIT);
- if (!kill(pid,0))
- return(0); /* failure refuse to die */
- else
- return(1); /* successful kill */
- } else
- return(1); /* successful kill with SIGHUP */
- }
-