Re: Possible mkfifo configuration bug

2019-01-02 Thread Andrew Janke

Thanks for the fix. This took care of the issue for us.

Cheers,
Andrew

On 12/28/18 1:29 AM, Paul Eggert wrote:
Thanks for reporting that. I installed the attached two patches into 
Gnulib. The first should fix the bug; the second fixes a couple of 
typos I noticed while fixing the bug.





Re: Possible mkfifo configuration bug

2018-12-27 Thread Paul Eggert
Thanks for reporting that. I installed the attached two patches into Gnulib. The 
first should fix the bug; the second fixes a couple of typos I noticed while 
fixing the bug.
>From 48469200f2a9da5f36a4ef35dbbf129839780bb0 Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Thu, 27 Dec 2018 22:22:41 -0800
Subject: [PATCH 1/2] mkfifo: bring back HAVE_MKFIFO macro

* m4/mkfifo.m4 (gl_FUNC_MKFIFO): #define HAVE_MKFIFO as needed.
Problem reported by Andrew Janke in:
https://lists.gnu.org/r/bug-gnulib/2018-12/msg00147.html
---
 ChangeLog| 7 +++
 m4/mkfifo.m4 | 4 +++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index d1f0d630e..406e08327 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-12-27  Paul Eggert  
+
+	mkfifo: bring back HAVE_MKFIFO macro
+	* m4/mkfifo.m4 (gl_FUNC_MKFIFO): #define HAVE_MKFIFO as needed.
+	Problem reported by Andrew Janke in:
+	https://lists.gnu.org/r/bug-gnulib/2018-12/msg00147.html
+
 2018-12-21  Bruno Haible  
 
 	Assume Autoconf >= 2.63.
diff --git a/m4/mkfifo.m4 b/m4/mkfifo.m4
index 668e786fc..6a05f311b 100644
--- a/m4/mkfifo.m4
+++ b/m4/mkfifo.m4
@@ -1,4 +1,4 @@
-# serial 7
+# serial 8
 # See if we need to provide mkfifo replacement.
 
 dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
@@ -27,6 +27,8 @@ AC_DEFUN([gl_FUNC_MKFIFO],
   if test $gl_cv_func_mkfifo = no; then
 HAVE_MKFIFO=0
   else
+AC_DEFINE([HAVE_MKFIFO], [1],
+  [Define to 1 if you have a 'mkfifo' function.])
 dnl Check for Solaris 9 and FreeBSD bug with trailing slash.
 AC_CHECK_FUNCS_ONCE([lstat])
 AC_CACHE_CHECK([whether mkfifo rejects trailing slashes],
-- 
2.17.1

>From a8e125d24942bc581fda1628a61a60b979ab7087 Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Thu, 27 Dec 2018 22:24:14 -0800
Subject: [PATCH 2/2] * lib/mknodat.c: Remove incorrect comments.

---
 lib/mknodat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/mknodat.c b/lib/mknodat.c
index f595b82d9..268d1ce61 100644
--- a/lib/mknodat.c
+++ b/lib/mknodat.c
@@ -34,7 +34,7 @@ mknodat (int fd _GL_UNUSED, char const *path _GL_UNUSED,
   return -1;
 }
 
-#else /* HAVE_MKFIFO */
+#else
 
 /* Create a file system node FILE relative to directory FD, with
access permissions and file type in MODE, and device type in DEV.
@@ -54,4 +54,4 @@ mknodat (int fd _GL_UNUSED, char const *path _GL_UNUSED,
 # undef AT_FUNC_POST_FILE_PARAM_DECLS
 # undef AT_FUNC_POST_FILE_ARGS
 
-#endif /* HAVE_MKFIFO */
+#endif
-- 
2.17.1



Possible mkfifo configuration bug

2018-12-27 Thread Andrew Janke

Hi, Gnulib maintainers,

I'm working with GNU Octave and we're having an issue with mkfifo in 
Gnulib. https://savannah.gnu.org/bugs/index.php?55273


When we configure and build Gnulib on macOS, it builds the mkfifo() 
replacement function that just returns an ENOSYS error, even though 
mkfifo is present. This results in all mkfifo() calls failing.


The configure output indicates that mkfifo is found:

configure:57847: checking for mkfifo
configure:57872: gcc -o conftest -g -O2 -D_THREAD_SAFE -pthread 
-I/usr/local/opt/readline/include -I/usr/local/opt/gettext/include 
-I/usr/local/opt/qt/include -I/usr/local/opt/sundials27/include 
-I/usr/local/opt/qscintilla2/include  -L/usr/local/opt/readline/lib 
-L/usr/local/opt/gettext/lib -L/usr/local/opt/libffi/lib 
-F/usr/local/opt/qt/lib -L/usr/local/opt/sundials27/lib 
-L/usr/local/opt/qscintilla2/lib conftest.c  -lm  >&5
ld: warning: directory not found for option 
'-L/usr/local/opt/sundials27/lib'

configure:57872: $? = 0
configure:57881: result: yes
configure:57887: checking whether mkfifo rejects trailing slashes
configure:57935: gcc -o conftest -g -O2 -D_THREAD_SAFE -pthread   -

But there is no HAVE_MKFIFO present in the resulting config.h file.

Manually doing a CPPFLAGS="-DHAVE_MKFIFO" fixes it.

Possibly related to this change: 
https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=b24b6bbf9cf4cdc0d5d011b20dd74916507a6153


There's no "HAVE_MKFIFO=1" statement anywhere in m4/mkfifo.m4 now. 
Should there be one in the "else" branch of "test $gl_cv_func_mkfifo = no"?


Cheers,
Andrew Janke