From: Michael Poole Date: Tue, 25 Jan 2005 01:37:01 +0000 (+0000) Subject: Fail earlier if no lex or yacc is found; fix resolver DNS bug. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=10137fcff95f69185c8097c835c09127b1a75167 Fail earlier if no lex or yacc is found; fix resolver DNS bug. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1304 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 919be06..7659815 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-01-24 Michael Poole + + * configure.in: Make sure that $LEX and $YACC are reasonable and + actually run. + + * configure: Regenerate. + + * ircd/ircd_res.c (check_resolver_timeout): Use correct macro to + test whether the timer is already pending. + 2005-01-23 Michael Poole * doc/example.conf (Kill): Fix typo in realname Kill block diff --git a/configure b/configure index 2e114da..ba2cf8c 100755 --- a/configure +++ b/configure @@ -8786,22 +8786,22 @@ _ACEOF fi fi -if test -x "$LEX" -then +if "$LEX" eq ":" ; then + { { echo "$as_me:$LINENO: error: Cannot find flex." >&5 +echo "$as_me: error: Cannot find flex." >&2;} + { (exit 1); exit 1; }; } +elif echo "" | $LEX -V -v --version > /dev/null 2>&1 ; then { { echo "$as_me:$LINENO: error: Cannot find flex." >&5 echo "$as_me: error: Cannot find flex." >&2;} { (exit 1); exit 1; }; } fi -if test -z "$LEXLIB" -then - { { echo "$as_me:$LINENO: error: - Cannot find a library with yywrap() in, but flex was found. +if test -z "$LEXLIB" ; then + { { echo "$as_me:$LINENO: error: Cannot find a library with yywrap() in, but flex was found. It's possible the compiler you're using ($CC) is incompatible with the installed library. See \`config.log' for more details." >&5 -echo "$as_me: error: - Cannot find a library with yywrap() in, but flex was found. +echo "$as_me: error: Cannot find a library with yywrap() in, but flex was found. It's possible the compiler you're using ($CC) is incompatible with the installed library. See \`config.log' for more details." >&2;} @@ -8851,8 +8851,11 @@ fi done test -n "$YACC" || YACC="yacc" -if test -z "$YACC" -then +if "$YACC" eq ":" ; then + { { echo "$as_me:$LINENO: error: Cannot find yacc." >&5 +echo "$as_me: error: Cannot find yacc." >&2;} + { (exit 1); exit 1; }; } +elif echo "" | $YACC -V -v --version > /dev/null 2>&1 ; then { { echo "$as_me:$LINENO: error: Cannot find yacc." >&5 echo "$as_me: error: Cannot find yacc." >&2;} { (exit 1); exit 1; }; } diff --git a/configure.in b/configure.in index 88ec8c7..2532dfb 100644 --- a/configure.in +++ b/configure.in @@ -142,16 +142,16 @@ AC_PATH_PROGS(SHPROG, sh, /bin/sh) dnl (F)LEX - needed for the new conf file parser AC_PROG_LEX -if test -x "$LEX" -then +dnl The autoconf docs say $LEX defaults to 'lex'. They lie. +if [ "$LEX" eq ":" ] ; then + AC_MSG_ERROR([Cannot find flex.]) +elif echo "" | $LEX -V -v --version > /dev/null 2>&1 ; then AC_MSG_ERROR([Cannot find flex.]) fi -if test -z "$LEXLIB" -then - AC_MSG_FAILURE([ - Cannot find a library with yywrap() in, but flex was found. - It's possible the compiler you're using ($CC) is incompatible with the +if test -z "$LEXLIB" ; then + AC_MSG_FAILURE([Cannot find a library with yywrap() in, but flex was found. + It's possible the compiler you're using ($CC) is incompatible with the installed library.]) fi @@ -159,8 +159,11 @@ LIBS="$LEXLIB $LIBS" dnl YACC - ditto AC_PROG_YACC -if test -z "$YACC" -then +dnl The autoconf docs say $YACC defaults to 'yacc'. This seems to be true, +dnl but judging from AC_PROG_LEX, it may not stay true. +if [ "$YACC" eq ":" ] ; then + AC_MSG_ERROR([Cannot find yacc.]) +elif echo "" | $YACC -V -v --version > /dev/null 2>&1 ; then AC_MSG_ERROR([Cannot find yacc.]) fi diff --git a/ircd/ircd_res.c b/ircd/ircd_res.c index c9960f6..e56c6cd 100644 --- a/ircd/ircd_res.c +++ b/ircd/ircd_res.c @@ -278,7 +278,7 @@ check_resolver_timeout(time_t when) { if (when > CurrentTime + AR_TTL) when = CurrentTime + AR_TTL; - if (!t_active(&res_timeout)) + if (!t_onqueue(&res_timeout)) timer_add(&res_timeout, timeout_resolver, NULL, TT_ABSOLUTE, when); else if (when < t_expire(&res_timeout)) timer_chg(&res_timeout, TT_ABSOLUTE, when);