From owner-freebsd-current Tue Jul 2 1:29:19 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F074A37B400; Tue, 2 Jul 2002 01:29:16 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id AEEF843E0A; Tue, 2 Jul 2002 01:29:15 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id SAA10417; Tue, 2 Jul 2002 18:29:12 +1000 Date: Tue, 2 Jul 2002 18:35:01 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Christian Weisgerber Cc: freebsd-current@FreeBSD.ORG Subject: Re: LP64: (int)signal() In-Reply-To: Message-ID: <20020702182320.X11383-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 1 Jul 2002, Christian Weisgerber wrote: > I would like to clean up the last instances of (int)signal(...) in > the tree. Any objection to the changes below? No, but ... > Other occurrences not worth touching: > - contrib/opie/opieftpd.c: contrib, not used > - libexec/bootpd/bootpd.c: #ifdef'ed out in favor of sigaction(). ... either the sigaction() or the signal() in bootpd.c is probably wrong, since the sigaction() is missing SA_RESTART. The signal() case has been ifdefed out for a long time, so this apparently doesn't matter much. This has very little to do with LP64 ... Mike Barcroft wrote: > You might want to get rid of the other misuse of `rc' above this and > just remove the variable. The use of an gratuitous int variable rc to capture return values is rampant throughout this code. In fact, not using it is something of a violation of the local style, but in the case of signal() I think it's justifiable because SIG_ERR is so much neater than changing rc to long and messing around with explicit casts. Casting signal() to long just gives undefined behaviour on different machines. It would be less incorrect to cast a magic integer to a function pointer like the implementation must do to create SIG_ERR (at least if the implementation starts with a magic integer), but it is so much neater to just use SIG_ERR. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message