From 566d54fe549286895fdef8aa9f385686405dd290 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Wed, 13 Oct 2021 16:46:20 -0700 Subject: RM(rc): old code. too many assumptions baked in --- sys/cmd/rc/trap.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 sys/cmd/rc/trap.c (limited to 'sys/cmd/rc/trap.c') diff --git a/sys/cmd/rc/trap.c b/sys/cmd/rc/trap.c deleted file mode 100644 index ef46143..0000000 --- a/sys/cmd/rc/trap.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "rc.h" -#include "exec.h" -#include "fns.h" -#include "io.h" -extern char *Signame[]; - -void -dotrap(void) -{ - int i; - struct Var *trapreq; - struct Word *starval; - starval = vlook("*")->val; - while(ntrap) for(i = 0;i!=NSIG;i++) while(trap[i]){ - --trap[i]; - --ntrap; - if(getpid()!=mypid) Exit(getstatus()); - trapreq = vlook(Signame[i]); - if(trapreq->fn){ - start(trapreq->fn, trapreq->pc, (struct Var *)0); - runq->local = newvar(strdup("*"), runq->local); - runq->local->val = copywords(starval, (struct Word *)0); - runq->local->changed = 1; - runq->redir = runq->startredir = 0; - } - else if(i==SIGINT || i==SIGQUIT){ - /* - * run the stack down until we uncover the - * command reading loop. Xreturn will exit - * if there is none (i.e. if this is not - * an interactive rc.) - */ - while(!runq->iflag) Xreturn(); - } - else Exit(getstatus()); - } -} -- cgit v1.2.1