trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r884815 - in /incubator/trafficserver/traffic/trunk: configure.ac iocore/hostdb/HostDB.cc
Date Fri, 27 Nov 2009 10:16:09 GMT
Author: pquerna
Date: Fri Nov 27 10:16:08 2009
New Revision: 884815

URL: http://svn.apache.org/viewvc?rev=884815&view=rev
Log:
TS-2: Check for rand functions via autoconf, rather than hard coding HOST_OS=freebsd.

Modified:
    incubator/trafficserver/traffic/trunk/configure.ac
    incubator/trafficserver/traffic/trunk/iocore/hostdb/HostDB.cc

Modified: incubator/trafficserver/traffic/trunk/configure.ac
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/configure.ac?rev=884815&r1=884814&r2=884815&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/configure.ac (original)
+++ incubator/trafficserver/traffic/trunk/configure.ac Fri Nov 27 10:16:08 2009
@@ -425,7 +425,7 @@
     AC_MSG_FAILURE([No DB interface found])
 fi
 
-AC_CHECK_FUNCS([clock_gettime kqueue epoll_ctl posix_memalign])
+AC_CHECK_FUNCS([clock_gettime kqueue epoll_ctl posix_memalign lrand48_r srand48_r])
 
 if test "$ac_cv_func_epoll_ctl" = "yes"; then
    AC_DEFINE([USE_EPOLL])

Modified: incubator/trafficserver/traffic/trunk/iocore/hostdb/HostDB.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/iocore/hostdb/HostDB.cc?rev=884815&r1=884814&r2=884815&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/iocore/hostdb/HostDB.cc (original)
+++ incubator/trafficserver/traffic/trunk/iocore/hostdb/HostDB.cc Fri Nov 27 10:16:08 2009
@@ -2274,7 +2274,7 @@
 {
   int outstanding;
   int total;
-#if (HOST_OS != freebsd)
+#ifdef HAVE_LRAND48_R
   struct drand48_data dr;
 #endif
 
@@ -2289,7 +2289,7 @@
     while (outstanding < HOSTDB_TEST_MAX_OUTSTANDING && total < HOSTDB_TEST_LENGTH)
     {
       long l = 0;
-#if (HOST_OS == freebsd)
+#ifndef HAVE_LRAND48_R
       l = lrand48();
 #else
       lrand48_r(&dr, &l);
@@ -2309,7 +2309,7 @@
   }
 HostDBTestReverse():Continuation(new_ProxyMutex()), outstanding(0), total(0) {
     SET_HANDLER((HostDBTestReverseHandler) & HostDBTestReverse::mainEvent);
-#if (HOST_OS == freebsd)
+#ifndef HAVE_SRAND48_R
     srand48(time(NULL));
 #else
     srand48_r(time(NULL), &dr);



Mime
View raw message