From owner-freebsd-current Mon Jan 24 8:24: 5 2000 Delivered-To: freebsd-current@freebsd.org Received: from cichlids.com (pC19F54BA.dip0.t-ipconnect.de [193.159.84.186]) by hub.freebsd.org (Postfix) with ESMTP id 04CE715A61; Mon, 24 Jan 2000 08:21:00 -0800 (PST) (envelope-from alex@cichlids.com) Received: from cichlids.cichlids.com (cichlids.cichlids.com [192.168.0.10]) by cichlids.com (Postfix) with ESMTP id C9995AB94; Mon, 24 Jan 2000 17:20:49 +0100 (CET) Received: (from alex@localhost) by cichlids.cichlids.com (8.9.3/8.9.3) id RAA16682; Mon, 24 Jan 2000 17:20:23 +0100 (CET) (envelope-from alex) Date: Mon, 24 Jan 2000 17:20:23 +0100 From: Alexander Langer To: Satoshi - Ports Wraith - Asami Cc: current@FreeBSD.ORG Subject: Re: sigisempty? Message-ID: <20000124172023.B5978@cichlids.cichlids.com> Mail-Followup-To: Satoshi - Ports Wraith - Asami , current@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="5vNYLRcllDrimb99" X-Mailer: Mutt 1.0i In-Reply-To: ; from asami@FreeBSD.ORG on Mon, Jan 24, 2000 at 06:03:40AM -0800 X-PGP-Fingerprint: 44 28 CA 4C 46 5B D3 A8 A8 E3 BA F3 4E 60 7D 7F X-Verwirrung: Dieser Header dient der allgemeinen Verwirrung. Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Thus spake Satoshi - Ports Wraith - Asami (asami@FreeBSD.ORG): > Langer. It has a nice feature of working for both -current and > -stable without any additional #ifdef's. I hope it's ok. I now saw Garret Wollman's function. I like the use of the static-vars. The use of sigemptyset makes it more transparenter for later changes, that I hope won't occur, but at the moment it doesn't matter since sigemptyset is int sigemptyset(set) sigset_t *set; { int i; for (i = 0; i < _SIG_WORDS; i++) set->__bits[i] = 0; return (0); } I attached a patch against patch-lo anyways (sorry ;-) Alex -- I doubt, therefore I might be. --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xview-patch.diff" --- /tmp/xview/patches/patch-lo Thu Jan 20 04:38:25 2000 +++ patch-lo Mon Jan 24 17:14:58 2000 @@ -20,15 +20,17 @@ union wait status; /* Return value from wait3 */ #else SVR4 int status; /* Return value from wait3 */ -@@ -188,7 +197,12 @@ +@@ -188,7 +197,14 @@ #define sigisempty(s) (!(((s)->__sigbits[0]) | ((s)->__sigbits[1]) \ | ((s)->__sigbits[2]) | ((s)->__sigbits[3]))) #else -#define sigisempty(s) (!(*(s))) +static int +sigisempty (sigset_t *s) { -+ sigset_t n; -+ bzero(&n, sizeof(sigset_t)); ++ static sigset_t n; ++ static int emptied = 0; ++ if (!emptied) ++ sigemptyset(&n), emptied++; + return (! memcmp(&n, s, sizeof(sigset_t))); +} #endif --5vNYLRcllDrimb99-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message