zsh-workers
 help / color / mirror / code / Atom feed
* build fails on systems without /dev/fd
@ 2018-05-16 21:31 ` Stephane Chazelas
  2018-05-17  8:44   ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Stephane Chazelas @ 2018-05-16 21:31 UTC (permalink / raw)
  To: Zsh hackers list

Hi,

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"

Reproduce by commenting out
#define PATH_DEV_FD
in config.h

-- 
Stephane


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: build fails on systems without /dev/fd
  2018-05-16 21:31 ` build fails on systems without /dev/fd Stephane Chazelas
@ 2018-05-17  8:44   ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2018-05-17  8:44 UTC (permalink / raw)
  To: Zsh hackers list

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.
  */



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-17  8:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20180516213205epcas3p21f26f4de3643a563f1ed41c7922bbee9@epcas3p2.samsung.com>
2018-05-16 21:31 ` build fails on systems without /dev/fd Stephane Chazelas
2018-05-17  8:44   ` Peter Stephenson

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).