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

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