From 9574c70b29516c80dfb7d83ff5a88b133941dd0e Mon Sep 17 00:00:00 2001 From: Stephane Bortzmeyer Date: Tue, 30 Jun 2009 14:19:07 +0000 Subject: [PATCH] Patch from ametzler to address bug #2811861 --- SRC/configure.ac | 23 +++++++++++++++-------- SRC/echoping.c | 14 +++++++------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/SRC/configure.ac b/SRC/configure.ac index 0bdcf1c..6f34851 100644 --- a/SRC/configure.ac +++ b/SRC/configure.ac @@ -92,14 +92,21 @@ AC_ARG_WITH(ssl, AC_ARG_WITH(gnutls, [ --with-gnutls[=DIR] SSL/TLS crypt support (needs GNU TLS), the argument DIR should not be necessary],dnl [if test "$withval" != "no"; then - AC_DEFINE(GNUTLS,,[Crypto (TLS) support]) - GNUTLS=1 - CPPFLAGS="${CPPFLAGS} `libgnutls-config --cflags`" - LDFLAGS="${LDFLAGS} `libgnutls-config --libs`" - if test "$withval" != "yes"; then - GNUTLSROOT=$withval - LDFLAGS="${LDFLAGS} -L$GNUTLSROOT/lib" - CPPFLAGS="${CPPFLAGS} -I$GNUTLSROOT/include" + if test "$withval" = "yes"; then + PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.0.0], + [ + echo "GnuTLS found" + AC_DEFINE(GNUTLS,,[Crypto (TLS) support]) + GNUTLS=1 + CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS" + LIBS="$LIBS $LIBGNUTLS_LIBS" + ],) + else + AC_DEFINE(GNUTLS,,[Crypto (TLS) support]) + GNUTLS=1 + GNUTLSROOT=$withval + LDFLAGS="${LDFLAGS} -L$GNUTLSROOT/lib -lgnutls" + CPPFLAGS="${CPPFLAGS} -I$GNUTLSROOT/include" fi fi], dnl Default: disable it diff --git a/SRC/echoping.c b/SRC/echoping.c index c3d0a43..1e6b203 100644 --- a/SRC/echoping.c +++ b/SRC/echoping.c @@ -32,7 +32,7 @@ unsigned int size = DEFLINE; unsigned int j = 0; int n_stddev = 0; -int family = PF_UNSPEC; +int family = AF_UNSPEC; struct result results[MAX_ITERATIONS]; struct timeval good_results[MAX_ITERATIONS]; @@ -678,8 +678,8 @@ main(argc, argv) #ifdef SMTP if (smtp) { sendline = "QUIT\r\n"; /* Surprises some SMTP servers which log a - * frightening NOQUEUE. Anyone knows better? * * * - * * See bug #1512776 */ + * frightening NOQUEUE. Anyone knows better? * * * * + * See bug #1512776 */ } else #endif #ifdef ICP @@ -907,9 +907,9 @@ main(argc, argv) } if (plugin) { plugin_result = plugin_execute(); - /* If plugin_result == -1, there is a temporary error and we did not - * get data, we must not use it in the average / median calculations. - * So, successes will not be incremented later. */ + /* If plugin_result == -1, there is a temporary error and we did not get + * data, we must not use it in the average / median calculations. So, + * successes will not be incremented later. */ if (plugin_result == -2) err_quit(""); } else { @@ -932,7 +932,7 @@ main(argc, argv) err_sys("Can't connect to server"); /* TODO: it would be better to continue: if -n was given, other * iterations may succeed. A flag indicating success or error is - * probably necessary, it would replace the mess around 'if + * * probably necessary, it would replace the mess around 'if * (!timeout_flag && (!plugin || plugin_result >= 0))' */ } else { if (tcp) {