1 diff -ur netbsd-sh/jobs.c netbsd-sh-/jobs.c
2 --- netbsd-sh/jobs.c Tue May 23 12:03:19 2000
3 +++ netbsd-sh-/jobs.c Mon Apr 23 23:31:47 2001
5 int initialpgrp; /* pgrp of shell on invocation */
6 short curjob; /* current job */
8 +STATIC int intreceived;
10 STATIC void restartjob __P((struct job *));
11 STATIC void freejob __P((struct job *));
13 STATIC int waitproc __P((int, int *));
14 STATIC void cmdtxt __P((union node *));
15 STATIC void cmdputs __P((const char *));
16 +STATIC void waitonint(int);
21 * Turn job control on and off.
32 TRACE(("Child shell %d\n", getpid()));
35 - for (i = njobs, p = jobtab ; --i >= 0 ; p++)
45 + for (i = njobs, p = jobtab ; --i >= 0 ; p++)
48 if (wasroot && iflag) {
55 + struct sigaction act, oact;
64 + sigaction(SIGINT, 0, &act);
65 + act.sa_handler = waitonint;
66 + sigaction(SIGINT, &act, &oact);
68 TRACE(("waitforjob(%%%d) called\n", jp - jobtab + 1));
69 while (jp->state == 0) {
77 + extern char *trap[];
78 + sigaction(SIGINT, &oact, 0);
79 + if (intreceived && trap[SIGINT]) kill(getpid(), SIGINT);
84 if (ioctl(2, TIOCSPGRP, (char *)&mypgrp) < 0)
105 +STATIC void waitonint(int sig) {