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

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