Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Aug 2000 18:59:26 +0100
From:      Ben Smithurst <ben@FreeBSD.org>
To:        "'Alfred Perlstein'" <bright@wintelcom.net>
Cc:        "Yevmenkin, Maksim N, CSCIO" <myevmenkin@att.com>, core-ix@hushmail.com, freebsd-hackers@FreeBSD.ORG
Subject:   Re: Preventing zombies to occure
Message-ID:  <20000825185926.D30144@strontium.scientia.demon.co.uk>
In-Reply-To: <20000825175439.C30144@strontium.scientia.demon.co.uk>
References:  <E598F159668DD311B9C700902799EAF44734E5@njb140po01.ems.att.com> <20000825062409.O1209@fw.wintelcom.net> <20000825175439.C30144@strontium.scientia.demon.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
> 'Alfred Perlstein' wrote:
> 
>> int
>> sigchld_handler(int) 
>> {
>> 
>> 	while (waitpid(-1, NULL, 0) || errno == EINTR)
>> 		;
>> }

actually, shouldn't you use WNOHANG when calling waitpid() there?  What
I normally do is

	int e = errno;

	while (waitpid(-1, NULL, WNOHANG) > 0)
		;

	errno = e;

But I think I'm drifting from the original point.

-- 
Ben Smithurst / ben@FreeBSD.org / PGP: 0x99392F7D


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000825185926.D30144>