From: Alan Cox Date: Mon, 11 May 2015 21:31:35 +0000 (+0100) Subject: sh: start trying to sort out signals X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=633d34b71f0a066f5f77e3c4d3fd71bc391c7140;p=FUZIX.git sh: start trying to sort out signals --- diff --git a/Applications/V7/cmd/sh/defs.h b/Applications/V7/cmd/sh/defs.h index 0ac03d13..6058c734 100644 --- a/Applications/V7/cmd/sh/defs.h +++ b/Applications/V7/cmd/sh/defs.h @@ -296,7 +296,7 @@ extern void makearg(register char *args); /* fault.c */ extern void fault(register int sig); extern void stdsigs(void); -extern int ignsig(int n); +extern sighandler_t ignsig(int n); extern void getsig(int n); extern void oldsigs(void); extern void clrsig(int i); diff --git a/Applications/V7/cmd/sh/fault.c b/Applications/V7/cmd/sh/fault.c index c35c7555..67d2559a 100644 --- a/Applications/V7/cmd/sh/fault.c +++ b/Applications/V7/cmd/sh/fault.c @@ -45,26 +45,24 @@ void stdsigs(void) getsig(ALARM); } -int ignsig(int n) +sighandler_t ignsig(int n) { - register int s, i; -#if 0 - // FIXME: need to do proper SIG_IGN checks/handling - if ((s = signal(i = n, 1) & 01) == 0) { + register int i; + sighandler_t s; + /* FIXME */ + /* Was a test of the low bit.. not clear this is the correct translation of V7 internals */ + if ((s = signal(i = n, SIG_IGN)) != SIG_IGN) trapflg[i] |= SIGMOD; - } -#endif - return (s); + return s; } void getsig(int n) { register int i; - if (trapflg[i = n] & SIGMOD || ignsig(i) == 0) { + /* Again was a zero test for ignsig, unclear if correct translation FIXME */ + if (trapflg[i = n] & SIGMOD || ignsig(i) == SIG_DFL) signal(i, fault); - ; - } } void oldsigs(void)