From owner-freebsd-hackers Fri Aug 25 10:15:42 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id B704837B42C for ; Fri, 25 Aug 2000 10:15:36 -0700 (PDT) Received: from strontium.scientia.demon.co.uk ([192.168.91.36] ident=root) by scientia.demon.co.uk with esmtp (Exim 3.16 #1) id 13SMka-000Lbe-00; Fri, 25 Aug 2000 17:54:40 +0100 Received: (from ben@localhost) by strontium.scientia.demon.co.uk (8.9.3/8.9.3) id RAA96635; Fri, 25 Aug 2000 17:54:39 +0100 (BST) (envelope-from ben) Date: Fri, 25 Aug 2000 17:54:39 +0100 From: Ben Smithurst To: "'Alfred Perlstein'" Cc: "Yevmenkin, Maksim N, CSCIO" , core-ix@hushmail.com, freebsd-hackers@FreeBSD.ORG Subject: Re: Preventing zombies to occure Message-ID: <20000825175439.C30144@strontium.scientia.demon.co.uk> References: <20000825062409.O1209@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20000825062409.O1209@fw.wintelcom.net> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG '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"); -- 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