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

Re: bug with named pipes and process substitution



On 2015/07/22, at 18:58, Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> 
> diff --git a/Src/jobs.c b/Src/jobs.c
> index 948f61b..a71df68 100644
(snip)
> @@ -1188,7 +1188,9 @@ pipecleanfilelist(LinkList filelist)
>     node = firstnode(filelist);
>     while (node) {
> 	Jobfile jf = (Jobfile)getdata(node);
> -	if (jf->is_fd) {
> +	if (jf->is_fd &&
> +	    (!proc_subst_only ||
> +	     fdtable[jf->u.fd] == FDT_PROC_SUBST)) {
> 	    LinkNode next = nextnode(node);

With this patch, build fails on cygwin where PATH_DEV_FD and
FDT_PROC_SUBST is not defined:

jobs.c:1193:28: error: 'FDT_PROC_SUBST' undeclared (first use in this function)
       fdtable[jf->u.fd] == FDT_PROC_SUBST)) {
                            ^

The following patch *seems* to work (at least D03procsubst.ztst succeeds),
but I haven't understood (will not understand) the full detail.


diff --git a/Src/jobs.c b/Src/jobs.c
index a71df68..9333488 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1189,8 +1189,11 @@ pipecleanfilelist(LinkList filelist, int proc_subst_only)
     while (node) {
 	Jobfile jf = (Jobfile)getdata(node);
 	if (jf->is_fd &&
-	    (!proc_subst_only ||
-	     fdtable[jf->u.fd] == FDT_PROC_SUBST)) {
+	    (!proc_subst_only
+#ifdef FDT_PROC_SUBST
+	     || fdtable[jf->u.fd] == FDT_PROC_SUBST
+#endif
+		)) {
 	    LinkNode next = nextnode(node);
 	    zclose(jf->u.fd);
 	    (void)remnode(filelist, node);





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