zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: build fails on systems without /dev/fd
Date: Thu, 17 May 2018 09:44:39 +0100	[thread overview]
Message-ID: <20180517094439.5dcac8fc@camnpupstephen.cam.scsc.local> (raw)
In-Reply-To: <20180516213133.GA7996@chaz.gmail.com>

On Wed, 16 May 2018 22:31:33 +0100
Stephane Chazelas <stephane.chazelas@gmail.com> 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.
  */



      reply	other threads:[~2018-05-17  8:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180516213205epcas3p21f26f4de3643a563f1ed41c7922bbee9@epcas3p2.samsung.com>
2018-05-16 21:31 ` Stephane Chazelas
2018-05-17  8:44   ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180517094439.5dcac8fc@camnpupstephen.cam.scsc.local \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).