summaryrefslogtreecommitdiffstats
path: root/patches/pure-ftpd-1.0.21/generic/configure_ac-snprintf-cacheable.diff
blob: 022741ebce2e73fc38136cc79ddb386f96373629 (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
#
# Committed-By: Marc Kleine-Budde <mkl@pengutronix.de>, 2006-11-29
#
# Error:
#
# check for snprintf 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
@@ -914,7 +914,9 @@ for (;;) {
   AC_MSG_RESULT(no)
 ])  
 
-AC_MSG_CHECKING(whether snprintf is C99 conformant)
+AC_CACHE_CHECK([whether snprintf is C99 conformant],
+  [ac_cv_conf_snprintf_type],
+[
 AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #ifdef STDC_HEADERS
@@ -937,13 +939,13 @@ int main(void)
         (int) snprintf(buf, sizeof buf, "12345678"));
     return 0;
 }
-]])],[CONF_SNPRINTF_TYPE=`cat conftestval`
-],[],[])
-AC_MSG_RESULT(done)
-if test "x$CONF_SNPRINTF_TYPE" = "x" ; then
+]])],[ac_cv_conf_snprintf_type=`cat conftestval`
+],[],[ac_cv_conf_snprintf_type=8])
+])
+if test "x$ac_cv_conf_snprintf_type" = "x" ; then
   AC_MSG_WARN(your operating system doesn't implement snprintf)
 else
-  AC_DEFINE_UNQUOTED(CONF_SNPRINTF_TYPE, $CONF_SNPRINTF_TYPE, [return value of an overflowed snprintf])
+  AC_DEFINE_UNQUOTED(CONF_SNPRINTF_TYPE, $ac_cv_conf_snprintf_type, [return value of an overflowed snprintf])
 fi