Date: Fri, 11 Feb 2000 17:02:18 +0100 From: Alexander Langer <alex@big.endian.de> To: ports@freebsd.org, current@freebsd.org Subject: make_sigset/split_sigset in -current Message-ID: <20000211170218.A2505@cichlids.cichlids.com>
next in thread | raw e-mail | index | archive | help
--9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Hello! Again. I wondered if the following patches could do stuff. scsh compiles/works now, but I really don't know if the following replacements can be done for the existing macros. Can they? I could not reproduce a situation where they are called, so. I just don't know. Please, tell me :-) Unfortunately, Martin (maintainer) did not response. Alex -- I need a new ~/.sig. --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch-af --- scsh/bsd/sigset.h.old Tue Feb 1 16:04:42 2000 +++ scsh/bsd/sigset.h Fri Feb 4 14:54:18 2000 @@ -2,9 +2,18 @@ ** These macros are OS-dependent, and must be defined per-OS. */ -#define make_sigset(maskp, hi, lo) (*maskp=((hi)<<24)|(lo)) +#define make_sigset(maskp, hi, lo) sigemptyset(maskp),\ + sigaddset(maskp, hi), \ + sigaddset(maskp, lo); -/* Not a procedure: */ -#define split_sigset(mask, hip, lop) \ - ((*(hip)=(mask>>24)&0xff), \ - (*(lop)=(mask&0xffffff))) +static void +split_sigset(sigset_t mask, int * hip, int * lop) { + int seen = 0; + int n; + for (n = 1; n <= _SIG_MAXSIG; n++) { + if (sigismember(&mask, n)) + (seen ? *hip : *lop) = n, seen++; + } + if (seen == 1) + *hip = 0; +} --9amGYk9869ThD9tj-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000211170218.A2505>