From da2b842fad6cd6feb408c139a13b6da10a8ffbc5 Mon Sep 17 00:00:00 2001 From: cracauer Date: Wed, 21 Apr 1999 11:52:39 +0000 Subject: Next approach to make loops in interactive interruptable. PR: bin/9173 --- bin/sh/jobs.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'bin/sh/jobs.c') diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index c08758e..07d7e16 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -39,7 +39,7 @@ static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95"; #endif static const char rcsid[] = - "$Id: jobs.c,v 1.22 1998/08/25 09:33:34 cracauer Exp $"; + "$Id: jobs.c,v 1.23 1998/09/08 13:16:52 cracauer Exp $"; #endif /* not lint */ #include @@ -213,7 +213,7 @@ fgcmd(argc, argv) #endif restartjob(jp); INTOFF; - status = waitforjob(jp); + status = waitforjob(jp, (int *)NULL); INTON; return status; } @@ -702,9 +702,10 @@ forkshell(jp, n, mode) */ int -waitforjob(jp) +waitforjob(jp, origstatus) struct job *jp; - { + int *origstatus; +{ #if JOBS int mypgrp = getpgrp(); #endif @@ -730,6 +731,8 @@ waitforjob(jp) curjob = jp - jobtab + 1; #endif status = jp->ps[jp->nprocs - 1].status; + if (origstatus != NULL) + *origstatus = status; /* convert to 8 bits */ if (WIFEXITED(status)) st = WEXITSTATUS(status); -- cgit v1.1