summaryrefslogtreecommitdiff
path: root/arch/um/os-Linux/signal.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2011-08-18 23:03:39 +0400
committerRichard Weinberger <richard@nod.at>2011-11-02 17:14:52 +0400
commit7eb122555c8583e1601b7a620c5a88c1e06c3eac (patch)
tree025b581845d16e22cf0ffb5c8d5853a670100588 /arch/um/os-Linux/signal.c
parent5d40de0f6e726dc9c48fb35815e0a6153e59e1dc (diff)
downloadlinux-7eb122555c8583e1601b7a620c5a88c1e06c3eac.tar.xz
um: merge hard_handler() instances, switch to use of SA_SIGINFO
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/os-Linux/signal.c')
-rw-r--r--arch/um/os-Linux/signal.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index 4fc3cd19ec69..2dde9f6d6c0f 100644
--- a/arch/um/os-Linux/signal.c
+++ b/arch/um/os-Linux/signal.c
@@ -127,7 +127,7 @@ void set_sigstack(void *sig_stack, int size)
static void (*handlers[_NSIG])(int sig, struct sigcontext *sc);
-void handle_signal(int sig, struct sigcontext *sc)
+static void handle_signal(int sig, struct sigcontext *sc)
{
unsigned long pending = 1UL << sig;
@@ -168,7 +168,11 @@ void handle_signal(int sig, struct sigcontext *sc)
} while (pending);
}
-extern void hard_handler(int sig);
+static void hard_handler(int sig, siginfo_t *info, void *p)
+{
+ struct ucontext *uc = p;
+ handle_signal(sig, (struct sigcontext *) &uc->uc_mcontext);
+}
void set_handler(int sig, void (*handler)(int), int flags, ...)
{
@@ -178,7 +182,7 @@ void set_handler(int sig, void (*handler)(int), int flags, ...)
int mask;
handlers[sig] = (void (*)(int, struct sigcontext *)) handler;
- action.sa_handler = hard_handler;
+ action.sa_sigaction = hard_handler;
sigemptyset(&action.sa_mask);
@@ -190,7 +194,7 @@ void set_handler(int sig, void (*handler)(int), int flags, ...)
if (sig == SIGSEGV)
flags |= SA_NODEFER;
- action.sa_flags = flags;
+ action.sa_flags = flags | SA_SIGINFO;
action.sa_restorer = NULL;
if (sigaction(sig, &action, NULL) < 0)
panic("sigaction failed - errno = %d\n", errno);