summaryrefslogtreecommitdiffstats
path: root/patches/pure-ftpd-1.0.21/generic/configure_ac-getgroups-cacheable.diff
blob: d077d42d567d74bb14a6de3f5c2008ecc7d7b3cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#
# Committed-By: Marc Kleine-Budde <mkl@pengutronix.de>, 2006-11-29
#
# Error:
#
# check for getgroups is not cross aware, make it cacheable and added cross default value
#
# State:
#
# should be commited
#
Index: pure-ftpd-1.0.21/configure.ac
===================================================================
--- pure-ftpd-1.0.21.orig/configure.ac
+++ pure-ftpd-1.0.21/configure.ac
@@ -949,7 +949,9 @@ else
 fi
 
 
-AC_MSG_CHECKING(whether getgroups 0 is sane)
+AC_CACHE_CHECK([whether getgroups 0 is sane],
+  [ac_cv_safe_getgroups_0],
+[
 AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #ifdef STDC_HEADERS
@@ -968,11 +970,14 @@ int main(void)
 {
     return getgroups(0, NULL) <= 0;
 }
-]])],[
-AC_MSG_RESULT(yes)
-AC_DEFINE(SAFE_GETGROUPS_0,,[Define is getgroups(0, NULL) works on your system])
-],[AC_MSG_RESULT(no)
-],[])
+]])],[ac_cv_safe_getgroups_0=yes
+],[ac_cv_safe_getgroups_0=no
+],[ac_cv_safe_getgroups_0=yes])
+])
+if test "x$ac_cv_safe_getgroups_0" = "xyes"
+then
+  AC_DEFINE(SAFE_GETGROUPS_0,,[Define is getgroups(0, NULL) works on your system])
+fi
 
 AC_MSG_CHECKING(whether realpath likes unreadable directories)
 AC_RUN_IFELSE([AC_LANG_SOURCE([[