diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-05-08 05:11:54 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-05-08 05:11:54 +0000 |
commit | e13b495e727750b1b229cbc269bfc56015535af8 (patch) | |
tree | fc7b4aa7014275d52ffb66e812588d468a74ca9f /shell | |
parent | e403c038d44ee6d171f73df680cfbd4bb3c35841 (diff) | |
download | busybox-w32-e13b495e727750b1b229cbc269bfc56015535af8.tar.gz busybox-w32-e13b495e727750b1b229cbc269bfc56015535af8.tar.bz2 busybox-w32-e13b495e727750b1b229cbc269bfc56015535af8.zip |
A few more structural updates for job control.
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@2573 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r-- | shell/hush.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/shell/hush.c b/shell/hush.c index 1cb5f39ab..d0b30ebac 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -1089,11 +1089,21 @@ static void insert_bg_job(struct pipe *pi) | |||
1089 | thejob->next = NULL; | 1089 | thejob->next = NULL; |
1090 | thejob->running_progs = thejob->num_progs; | 1090 | thejob->running_progs = thejob->num_progs; |
1091 | thejob->stopped_progs = 0; | 1091 | thejob->stopped_progs = 0; |
1092 | thejob->text = xmalloc(MAX_LINE); | ||
1093 | |||
1094 | //if (pi->progs[0] && pi->progs[0].argv && pi->progs[0].argv[0]) | ||
1095 | { | ||
1096 | char *bar=thejob->text; | ||
1097 | char **foo=pi->progs[0].argv; | ||
1098 | while(foo && *foo) { | ||
1099 | bar += sprintf(bar, "%s ", *foo++); | ||
1100 | } | ||
1101 | } | ||
1092 | 1102 | ||
1093 | /* we don't wait for background thejobs to return -- append it | 1103 | /* we don't wait for background thejobs to return -- append it |
1094 | to the list of backgrounded thejobs and leave it alone */ | 1104 | to the list of backgrounded thejobs and leave it alone */ |
1095 | printf("[%d] %d\n", pi->jobid, pi->pgrp); | 1105 | printf("[%d] %d\n", thejob->jobid, thejob->progs[0].pid); |
1096 | last_bg_pid = pi->pgrp; | 1106 | last_bg_pid = thejob->progs[0].pid; |
1097 | } | 1107 | } |
1098 | 1108 | ||
1099 | /* remove a backgrounded job from a jobset */ | 1109 | /* remove a backgrounded job from a jobset */ |
@@ -1169,8 +1179,7 @@ static void checkjobs() | |||
1169 | pi->progs[prognum].is_stopped = 1; | 1179 | pi->progs[prognum].is_stopped = 1; |
1170 | 1180 | ||
1171 | if (pi->stopped_progs == pi->num_progs) { | 1181 | if (pi->stopped_progs == pi->num_progs) { |
1172 | printf(JOB_STATUS_FORMAT, pi->jobid, "Stopped", | 1182 | printf(JOB_STATUS_FORMAT, pi->jobid, "Stopped", pi->text); |
1173 | pi->text); | ||
1174 | } | 1183 | } |
1175 | } | 1184 | } |
1176 | } | 1185 | } |