瀏覽代碼

Ticket #462 - add test for include file mntent.h

https://fedorahosted.org/389/ticket/462
Reviewed by: rmeggins
Fixed by: cgrzemba
Branch: master
Fix Description: Add mntent.h to AC_CHECK_HEADERS - do not include
mntent.h unless HAVE_MNTENT_H is defined.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
Rich Megginson 13 年之前
父節點
當前提交
533cc7a464
共有 4 個文件被更改,包括 8 次插入2 次删除
  1. 3 0
      config.h.in
  2. 2 1
      configure
  3. 1 1
      configure.ac
  4. 2 0
      ldap/servers/slapd/daemon.c

+ 3 - 0
config.h.in

@@ -163,6 +163,9 @@
 /* Define to 1 if you have a working `mmap' system call. */
 #undef HAVE_MMAP
 
+/* Define to 1 if you have the <mntent.h> header file. */
+#undef HAVE_MNTENT_H
+
 /* Define to 1 if you have the `munmap' function. */
 #undef HAVE_MUNMAP
 

+ 2 - 1
configure

@@ -16362,7 +16362,8 @@ fi
 
 
 
-for ac_header in arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h unistd.h inttypes.h
+
+for ac_header in arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h unistd.h inttypes.h mntent.h
 do
 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then

+ 1 - 1
configure.ac

@@ -34,7 +34,7 @@ AC_PROG_LIBTOOL
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h unistd.h inttypes.h])
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h unistd.h inttypes.h mntent.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_HEADER_STAT

+ 2 - 0
ldap/servers/slapd/daemon.c

@@ -59,8 +59,10 @@
 #include <sys/time.h>
 #include <sys/wait.h>
 #include <pthread.h>
+#if defined(HAVE_MNTENT_H)
 #include <mntent.h>
 #endif
+#endif
 #include <time.h>
 #include <signal.h>
 #if defined(IRIX6_2) || defined(IRIX6_3)