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

Re: build fails on systems without /dev/fd



On Wed, 16 May 2018 22:31:33 +0100
Stephane Chazelas <stephane.chazelas@xxxxxxxxx> wrote:
> building zsh on FreeBSD when /dev/fd is not mounted, I get:
> 
> exec.c: In function ‘closem’:
> exec.c:4372:28: error: ‘FDT_PROC_SUBST’ undeclared (first use in this
> function) (all || fdtable[i] != FDT_PROC_SUBST) &&
> 
> I wouldn't know if it's only a matter of #ifdef'ing out the "||
> fdtable[i] != FDT_PROC_SUBST"

Hmm... we don't need all that scar tissue associated with the fact this
value is only sometimes defined, and given it now means we'd have to
cast "alL" to void, I've decided that's beyond the pain barrier.

Here's a more comprehensive change (that chunk in exec.c now doesn't
need any work).

pws

diff --git a/Src/jobs.c b/Src/jobs.c
index 330ee6b..38b3d89 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1258,11 +1258,7 @@ pipecleanfilelist(LinkList filelist, int proc_subst_only)
     while (node) {
 	Jobfile jf = (Jobfile)getdata(node);
 	if (jf->is_fd &&
-	    (!proc_subst_only
-#ifdef FDT_PROC_SUBST
-	     || fdtable[jf->u.fd] == FDT_PROC_SUBST
-#endif
-		)) {
+	    (!proc_subst_only || fdtable[jf->u.fd] == FDT_PROC_SUBST)) {
 	    LinkNode next = nextnode(node);
 	    zclose(jf->u.fd);
 	    (void)remnode(filelist, node);
diff --git a/Src/zsh.h b/Src/zsh.h
index 8b48984..8535d48 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -454,15 +454,14 @@ enum {
  * so the shell can still exec the last process.
  */
 #define FDT_FLOCK_EXEC		6
-#ifdef PATH_DEV_FD
 /*
  * Entry used by a process substition.
  * This marker is not tested internally as we associated the file
  * descriptor with a job for closing.
+ *
+ * This is not used unless PATH_DEV_FD is defined.
  */
 #define FDT_PROC_SUBST		7
-#endif
-
 /*
  * Mask to get the basic FDT type.
  */




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