From 19dde5cd3bfa1ac7b0980022c3a13c771f51d84d Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 25 Apr 2003 19:26:18 +0000 Subject: [PATCH] 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 --- sys/compat/linux/linux_signal.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index a69f27d07c8..4eb92e46755 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);