From owner-freebsd-hackers Fri Aug 25 11:28:59 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 27B0937B443; Fri, 25 Aug 2000 11:28:48 -0700 (PDT) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e7PISlV25020; Fri, 25 Aug 2000 11:28:47 -0700 (PDT) Date: Fri, 25 Aug 2000 11:28:47 -0700 From: "'Alfred Perlstein'" To: Ben Smithurst Cc: "Yevmenkin, Maksim N, CSCIO" , core-ix@hushmail.com, freebsd-hackers@FreeBSD.org Subject: Re: Preventing zombies to occure Message-ID: <20000825112847.Z1209@fw.wintelcom.net> References: <20000825062409.O1209@fw.wintelcom.net> <20000825175439.C30144@strontium.scientia.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: <20000825175439.C30144@strontium.scientia.demon.co.uk>; from ben@FreeBSD.org on Fri, Aug 25, 2000 at 05:54:39PM +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Ben Smithurst [000825 10:15] wrote: > 'Alfred Perlstein' wrote: > > > int > > sigchld_handler(int) > > { > > > > while (waitpid(-1, NULL, 0) || errno == EINTR) > > ; > > } > > Even more paranoid would be > > int > sigchld_handler(int) > { > int e = errno; > > while (waitpid(-1, NULL, 0) || errno == EINTR) > ; > > errno = e; > } > > otherwise you could get bogus errors reported, I think. > > if ((fp = fopen(foo, "r")) == NULL) > /* SIGCHLD arrives here */ > warn("can't open foo"); The code I presented is flawed as a result of an allnighter dealing with postresql. I'll enjoy thinking about this over the weekend. :) -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message