/*ARGSUSED*/
int
killpl(cp, arg)
	struct	candidate *cp;
	s_char	*arg;
{
	extern	s_char playerbin[];
	extern	int errno;
	struct	login *lp;

	if (*cp->password == 0)
		sendclient(cp->iop, C_CMDERR, "no password entered");
	else if (cp->cnum < 0)
		sendclient(cp->iop, C_CMDERR, "no country entered");
	else if ((lp = lo_cnum((natid)cp->cnum)) != 0) {
		if (kill(lp->pid, 0) < 0) {
			logerror("country %d 'in use' but pid %d not found",
				cp->cnum, lp->pid);
			lo_delete(lp);
			sendclient(cp->iop, C_EXIT, "process terminated");
		} else if (kill(lp->pid, SIGKILL) < 0)
			sendclient(cp->iop, C_EXIT,
				"process %d cannot be terminated", lp->pid);
		else
			sendclient(cp->iop, C_EXIT, 
				"process %d (from %s@%s) terminated",
				lp->pid, lp->remuser, lp->remhost);
	}
	else
		sendclient(cp->iop, C_EXIT, "country not in use");

	return 0;
}
