Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Jan 2000 17:20:23 +0100
From:      Alexander Langer <alex@big.endian.de>
To:        Satoshi - Ports Wraith - Asami <asami@FreeBSD.ORG>
Cc:        current@FreeBSD.ORG
Subject:   Re: sigisempty?
Message-ID:  <20000124172023.B5978@cichlids.cichlids.com>
In-Reply-To: <vqcr9f7sh1f.fsf@silvia.hip.berkeley.edu>; from asami@FreeBSD.ORG on Mon, Jan 24, 2000 at 06:03:40AM -0800
References:  <Pine.BSF.4.21.0001200800100.1541-100000@alphplex.bde.org> <vqcr9f7sh1f.fsf@silvia.hip.berkeley.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

--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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000124172023.B5978>