修訂 | 27 (tree) |
---|---|
時間 | 2007-12-08 18:33:39 |
作者 | ywtnb |
minor fix, 単パイプラインの BG を実装
@@ -232,9 +232,10 @@ | ||
232 | 232 | bool iscurrent, isbg; |
233 | 233 | normal: |
234 | 234 | iscurrent = (currentjobnumber == jobnumber); |
235 | - isbg = (job->j_status == JS_RUNNING) && !iscurrent; | |
235 | + isbg = (job->j_status == JS_RUNNING); | |
236 | 236 | printf("[%zu]%c %5d %-8s %s%s\n", |
237 | - jobnumber, iscurrent ? '+' : ' ', | |
237 | + jobnumber, | |
238 | + iscurrent ? '+' : ' ', | |
238 | 239 | (int) job->j_pgid, jstatusstr[job->j_status], |
239 | 240 | job->j_name ? : "<< unknown job >>", |
240 | 241 | isbg ? " &" : ""); |
@@ -528,7 +529,15 @@ | ||
528 | 529 | if (!s->s_bg) { |
529 | 530 | exec_pipelines(s->s_pipeline); |
530 | 531 | } else { |
531 | - error(0, 0, "background not supported"); // TODO | |
532 | + PIPELINE *p = s->s_pipeline; | |
533 | + if (p && !p->next) { | |
534 | + char *name = make_pipeline_name( | |
535 | + p->pl_proc, p->pl_neg, p->pl_loop); | |
536 | + exec_processes(p->pl_proc, name, p->pl_neg, p->pl_loop, true); | |
537 | + free(name); | |
538 | + } else { | |
539 | + error(0, 0, "background not supported"); // TODO | |
540 | + } | |
532 | 541 | } |
533 | 542 | s = s->next; |
534 | 543 | } |
@@ -601,7 +610,7 @@ | ||
601 | 610 | .j_statuschanged = true, |
602 | 611 | .j_flags = 0, |
603 | 612 | .j_exitstatus = 0, |
604 | - .j_exitcodeneg = 0, | |
613 | + .j_exitcodeneg = neg, | |
605 | 614 | .j_name = xstrdup(name), |
606 | 615 | }; |
607 | 616 | laststatus = 0; |