diff options
author | jhb <jhb@FreeBSD.org> | 2003-04-25 19:26:18 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-04-25 19:26:18 +0000 |
commit | 10710f6bc90e194670a95f2657cecc7208bc5152 (patch) | |
tree | e01a16d61d78df65d550803daf7b43f5f79b8c9f /sys/compat/linux | |
parent | f47e0d3774328eac462a423fdf88706ac3f89c52 (diff) | |
download | FreeBSD-src-10710f6bc90e194670a95f2657cecc7208bc5152.zip FreeBSD-src-10710f6bc90e194670a95f2657cecc7208bc5152.tar.gz |
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>
Diffstat (limited to 'sys/compat/linux')
-rw-r--r-- | sys/compat/linux/linux_signal.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index a69f27d..4eb92e4 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -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); |