• R/O
  • SSH
  • HTTPS

yash: 提交


Commit MetaInfo

修訂4137 (tree)
時間2020-11-03 21:55:17
作者magicant

Log Message

Return Exit_NOEXEC from failed asynchronous list

Change Summary

差異

--- yash/trunk/exec.c (revision 4136)
+++ yash/trunk/exec.c (revision 4137)
@@ -404,6 +404,7 @@
404404 job_T *job = xmallocs(sizeof *job, count, sizeof *job->j_procs);
405405 command_T *c;
406406 process_T *p;
407+ int forkstatus = Exit_SUCCESS;
407408 for (c = cs, p = job->j_procs; c != NULL; c = c->next, p++) {
408409 bool is_last = c->next == NULL;
409410 next_pipe(&pipe, !is_last);
@@ -433,7 +434,7 @@
433434 /* parent process: fork failed */
434435 p->pr_pid = 0;
435436 p->pr_status = JS_DONE;
436- p->pr_statuscode = Exit_NOEXEC;
437+ p->pr_statuscode = forkstatus = Exit_NOEXEC;
437438 p->pr_name = NULL;
438439 }
439440 }
@@ -457,8 +458,7 @@
457458 put_foreground(shell_pgid);
458459 laststatus = calc_status_of_job(job);
459460 } else {
460- // TODO laststatus should be Exit_NOEXEC if fork failed
461- laststatus = Exit_SUCCESS;
461+ laststatus = forkstatus;
462462 lastasyncpid = job->j_procs[count - 1].pr_pid;
463463 }
464464
Show on old repository browser