From owner-freebsd-current Mon Jul 1 8:23: 3 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 91CAF37B400; Mon, 1 Jul 2002 08:22:59 -0700 (PDT) Received: from espresso.q9media.com (espresso.q9media.com [65.39.129.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B6DC43E1A; Mon, 1 Jul 2002 08:22:59 -0700 (PDT) (envelope-from mike@espresso.q9media.com) Received: by espresso.q9media.com (Postfix, from userid 1002) id 2126D9C11; Mon, 1 Jul 2002 11:19:19 -0400 (EDT) Date: Mon, 1 Jul 2002 11:19:19 -0400 From: Mike Barcroft To: Christian Weisgerber Cc: freebsd-current@freebsd.org Subject: Re: LP64: (int)signal() Message-ID: <20020701111919.B20124@espresso.q9media.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ; from naddy@freebsd.org on Mon, Jul 01, 2002 at 11:46:10AM +0000 Organization: The FreeBSD Project 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 Christian Weisgerber writes: > I would like to clean up the last instances of (int)signal(...) in > the tree. Any objection to the changes below? > > Other occurrences not worth touching: > - contrib/opie/opieftpd.c: contrib, not used > - libexec/bootpd/bootpd.c: #ifdef'ed out in favor of sigaction(). > > Index: atmarpd/atmarpd.c > =================================================================== > RCS file: /home/ncvs/src/usr.sbin/atm/atmarpd/atmarpd.c,v > retrieving revision 1.4 > diff -u -r1.4 atmarpd.c > --- atmarpd/atmarpd.c 9 Dec 2000 09:35:42 -0000 1.4 > +++ atmarpd/atmarpd.c 1 Jul 2002 11:38:07 -0000 > @@ -294,8 +294,7 @@ > /* > * Set up signal handlers > */ > - rc = (int)signal(SIGINT, atmarp_sigint); > - if (rc == -1) { > + if (signal(SIGINT, atmarp_sigint) == SIG_ERR) { > atmarp_log(LOG_ERR, "SIGINT signal setup failed"); > exit(1); > } You might want to get rid of the other misuse of `rc' above this and just remove the variable. > Index: scspd/scspd.c > =================================================================== > RCS file: /home/ncvs/src/usr.sbin/atm/scspd/scspd.c,v > retrieving revision 1.4 > diff -u -r1.4 scspd.c > --- scspd/scspd.c 9 Dec 2000 09:35:42 -0000 1.4 > +++ scspd/scspd.c 1 Jul 2002 11:38:08 -0000 > @@ -319,14 +319,12 @@ > /* > * Set up signal handlers > */ > - rc = (int)signal(SIGHUP, scsp_sighup); > - if (rc == -1) { > + if (signal(SIGHUP, scsp_sighup) == SIG_ERR) { > scsp_log(LOG_ERR, "SIGHUP signal setup failed"); > exit(1); > } > > - rc = (int)signal(SIGINT, scsp_sigint); > - if (rc == -1) { > + if (signal(SIGINT, scsp_sigint) == SIG_ERR) { > scsp_log(LOG_ERR, "SIGINT signal setup failed"); > exit(1); > } [Repeat above sentence.] :) Otherwise it looks good. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message