Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: struct job.other (was Re: Bug related to stdin/always/jobcontrol)



On Sun, 25 Sep 2016 15:54:36 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sep 25,  3:39pm, Peter Stephenson wrote:
> }
> } > jn->other is a job table index, not a process ID.
> } 
> } The code's correct as it stands (modulo problems setting the values it's
> } using) -- read my previous explanations and the updated comment in zsh.h
> 
> OK, thanks ... how about this:
> 
> diff --git a/Src/exec.c b/Src/exec.c
> index 4e89340..c27c41c 100644
> --- a/Src/exec.c
> +++ b/Src/exec.c
> @@ -1702,7 +1702,7 @@ execpline(Estate state, wordcode slcode, int how, int last1)
>  			    jobtab[list_pipe_job].other = newjob;
>  			    jobtab[list_pipe_job].stat |= STAT_SUPERJOB;
>  			    jn->stat |= STAT_SUBJOB | STAT_NOPRINT;
> -			    jn->other = pid;
> +			    jn->other = list_pipe_pid;	/* see zsh.h */
>  			    if (hasprocs(list_pipe_job))
>  				jn->gleader = jobtab[list_pipe_job].gleader;
>  			}
> 

That's OK; I assume there's no race where list_pipe_pid is set to
something else since signals are blocked.

Same thing happens at line 1597, which is the code I added for the new
case with "ls | func".

pws



Messages sorted by: Reverse Date, Date, Thread, Author