summaryrefslogtreecommitdiffstats
path: root/bin/sh/jobs.c
diff options
context:
space:
mode:
authorcracauer <cracauer@FreeBSD.org>1999-04-21 11:52:39 +0000
committercracauer <cracauer@FreeBSD.org>1999-04-21 11:52:39 +0000
commitda2b842fad6cd6feb408c139a13b6da10a8ffbc5 (patch)
tree84a311efb1fdc9d20cd0218f25bee08ff1aa36e0 /bin/sh/jobs.c
parentd9c00667012aae534fe05e09eeff108a46bf3307 (diff)
downloadFreeBSD-src-da2b842fad6cd6feb408c139a13b6da10a8ffbc5.zip
FreeBSD-src-da2b842fad6cd6feb408c139a13b6da10a8ffbc5.tar.gz
Next approach to make loops in interactive interruptable.
PR: bin/9173
Diffstat (limited to 'bin/sh/jobs.c')
-rw-r--r--bin/sh/jobs.c11
1 files changed, 7 insertions, 4 deletions
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 <fcntl.h>
@@ -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);
OpenPOWER on IntegriCloud