Blame SOURCES/autofs-5.1.3-update-configure-to-check-for-pipe2.patch

cef8f8
commit f103a48636a7979c68c7a64cb381a4d0942c5109
cef8f8
Author: Ian Kent <raven@themaw.net>
cef8f8
Date:   Mon Nov 13 09:48:39 2017 +0800
cef8f8
cef8f8
    autofs-5.1.3 - update configure to check for pipe2(2)
cef8f8
    
cef8f8
    In a bug report by John Salmon it appears that the use of __have_pipe2
cef8f8
    isn't doing what's needed when checking for pipe2(2).
cef8f8
    
cef8f8
    Hopefully updating configure to explicity check for pipe2(2), lifted
cef8f8
    from John's patch, will be more reliable.
cef8f8
    
cef8f8
    Signed-off-by: Ian Kent <raven@themaw.net>
cef8f8
cef8f8
---
cef8f8
 CHANGELOG           |    1 +
cef8f8
 configure           |   12 ++++++++++++
cef8f8
 configure.in        |    2 ++
cef8f8
 include/automount.h |    2 +-
cef8f8
 include/config.h.in |    3 +++
cef8f8
 5 files changed, 19 insertions(+), 1 deletion(-)
cef8f8
cef8f8
--- autofs-5.0.7.orig/CHANGELOG
cef8f8
+++ autofs-5.0.7/CHANGELOG
cef8f8
@@ -285,6 +285,7 @@
cef8f8
 - fix memory leak in umount_amd_ext_mount().
cef8f8
 - fix strerror_r() parameter declaration in do program_mount().
cef8f8
 - fix incorrect check in validate_program_options().
cef8f8
+- update configure to check for pipe2(2).
cef8f8
 
cef8f8
 25/07/2012 autofs-5.0.7
cef8f8
 =======================
cef8f8
--- autofs-5.0.7.orig/configure.in
cef8f8
+++ autofs-5.0.7/configure.in
cef8f8
@@ -153,6 +153,8 @@ AF_CHECK_SSS_LIB(SSS_AUTOFS, libsss_auto
cef8f8
 AC_SUBST(HAVE_SSS_AUTOFS)
cef8f8
 AC_SUBST(sssldir)
cef8f8
 
cef8f8
+AC_CHECK_FUNCS(pipe2)
cef8f8
+
cef8f8
 #
cef8f8
 # Newer mounts have the -s (sloppy) option to ignore unknown options,
cef8f8
 # good for portability
cef8f8
--- autofs-5.0.7.orig/include/automount.h
cef8f8
+++ autofs-5.0.7/include/automount.h
cef8f8
@@ -653,7 +653,7 @@ static inline int open_pipe(int pipefd[2
cef8f8
 {
cef8f8
 	int ret;
cef8f8
 
cef8f8
-#if defined(O_CLOEXEC) && defined(SOCK_CLOEXEC) && defined(__have_pipe2)
cef8f8
+#if defined(O_CLOEXEC) && defined(SOCK_CLOEXEC) && defined(HAVE_PIPE2)
cef8f8
 	if (cloexec_works != -1) {
cef8f8
 		ret = pipe2(pipefd, O_CLOEXEC);
cef8f8
 		if (ret != -1)
cef8f8
--- autofs-5.0.7.orig/include/config.h.in
cef8f8
+++ autofs-5.0.7/include/config.h.in
cef8f8
@@ -54,6 +54,9 @@
cef8f8
 /* define if you have MOUNT_NFS */
cef8f8
 #undef HAVE_MOUNT_NFS
cef8f8
 
cef8f8
+/* Define to 1 if you have the `pipe2' function. */
cef8f8
+#undef HAVE_PIPE2
cef8f8
+
cef8f8
 /* define if the mount command supports the -s option */
cef8f8
 #undef HAVE_SLOPPY_MOUNT
cef8f8
 
cef8f8
--- autofs-5.0.7.orig/configure
cef8f8
+++ autofs-5.0.7/configure
cef8f8
@@ -3955,6 +3955,18 @@ fi
cef8f8
 
cef8f8
 
cef8f8
 
cef8f8
+for ac_func in pipe2
cef8f8
+do :
cef8f8
+  ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2"
cef8f8
+if test "x$ac_cv_func_pipe2" = xyes; then :
cef8f8
+  cat >>confdefs.h <<_ACEOF
cef8f8
+#define HAVE_PIPE2 1
cef8f8
+_ACEOF
cef8f8
+
cef8f8
+fi
cef8f8
+done
cef8f8
+
cef8f8
+
cef8f8
 #
cef8f8
 # Newer mounts have the -s (sloppy) option to ignore unknown options,
cef8f8
 # good for portability