Use a switch to convert the Linux sigprocmask flags to the equivalent

FreeBSD flags instead of just adding one to the Linux flags.  This should
be identical to the previous version except that I have at least one report
of this patch fixing problems people were having with Linux apps after my
last commit to this file.  It is safer to use the switch then to make
assumptions about the flag values anyways, esp. since we currently use
MD defines for the values of the flags and this is MI code.

Tested by:	Michael Class <michael_class@gmx.net>
This commit is contained in:
John Baldwin 2003-04-25 19:26:18 +00:00
parent 90d1947ebc
commit 19dde5cd3b

View File

@ -233,14 +233,25 @@ linux_do_sigprocmask(struct thread *td, int how, l_sigset_t *new,
td->td_retval[0] = 0;
switch (how) {
case LINUX_SIG_BLOCK:
how = SIG_BLOCK;
break;
case LINUX_SIG_UNBLOCK:
how = SIG_UNBLOCK;
break;
case LINUX_SIG_SETMASK:
how = SIG_SETMASK;
break;
default:
return (EINVAL);
}
if (new != NULL) {
linux_to_bsd_sigset(new, &nmask);
nmaskp = &nmask;
} else
nmaskp = NULL;
/* Linux sigprocmask flag values are one less than FreeBSD values. */
error = kern_sigprocmask(td, how + 1, nmaskp, &omask, 0);
error = kern_sigprocmask(td, how, nmaskp, &omask, 0);
if (error != 0 && old != NULL)
bsd_to_linux_sigset(&omask, old);