~ubuntu-branches/ubuntu/precise/9base/precise

« back to all changes in this revision

Viewing changes to rc/trap.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-08-20 17:34:06 UTC
  • mfrom: (6.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090820173406-xpwqa9ruyevvc0ut
Tags: 1:3-3
* Updating maintainer field.
* Updating vcs fields.
* Updating package to standards version 3.8.3.
* Updatin variables writing in rules to consistent style.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#include "fns.h"
4
4
#include "io.h"
5
5
extern char *Signame[];
6
 
void dotrap(void){
7
 
        register int i;
8
 
        register struct var *trapreq;
9
 
        register struct word *starval;
10
 
        starval=vlook("*")->val;
11
 
        while(ntrap) for(i=0;i!=NSIG;i++) while(trap[i]){
 
6
 
 
7
void
 
8
dotrap(void)
 
9
{
 
10
        int i;
 
11
        struct var *trapreq;
 
12
        struct word *starval;
 
13
        starval = vlook("*")->val;
 
14
        while(ntrap) for(i = 0;i!=NSIG;i++) while(trap[i]){
12
15
                --trap[i];
13
16
                --ntrap;
14
17
                if(getpid()!=mypid) Exit(getstatus());
15
 
                trapreq=vlook(Signame[i]);
 
18
                trapreq = vlook(Signame[i]);
16
19
                if(trapreq->fn){
17
20
                        start(trapreq->fn, trapreq->pc, (struct var *)0);
18
 
                        runq->local=newvar(strdup("*"), runq->local);
19
 
                        runq->local->val=copywords(starval, (struct word *)0);
20
 
                        runq->local->changed=1;
21
 
                        runq->redir=runq->startredir=0;
 
21
                        runq->local = newvar(strdup("*"), runq->local);
 
22
                        runq->local->val = copywords(starval, (struct word *)0);
 
23
                        runq->local->changed = 1;
 
24
                        runq->redir = runq->startredir = 0;
22
25
                }
23
26
                else if(i==SIGINT || i==SIGQUIT){
24
27
                        /*