trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1074389 - /trafficserver/traffic/trunk/proxy/ControlBase.cc
Date Fri, 25 Feb 2011 03:28:04 GMT
Author: amc
Date: Fri Feb 25 03:28:03 2011
New Revision: 1074389

URL: http://svn.apache.org/viewvc?rev=1074389&view=rev
Log:
TS-674 : fix time_t printf problem

Modified:
    trafficserver/traffic/trunk/proxy/ControlBase.cc

Modified: trafficserver/traffic/trunk/proxy/ControlBase.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/ControlBase.cc?rev=1074389&r1=1074388&r2=1074389&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/ControlBase.cc (original)
+++ trafficserver/traffic/trunk/proxy/ControlBase.cc Fri Feb 25 03:28:03 2011
@@ -84,7 +84,11 @@ ControlBase::Modifier::Type TimeMod::typ
 char const * TimeMod::name() const { return NAME; }
 
 void TimeMod::print(FILE* f) const {
-  fprintf(f, "%s=%ld-%ld  ", this->name(), start_time, end_time);
+  fprintf(f, "%s=%ld-%ld  ",
+    // Have to cast because time_t can be 32 or 64 bits and the compiler
+    // will barf if format code doesn't match.
+    this->name(), static_cast<long>(start_time), static_cast<long>(end_time)
+  );
 }
 bool TimeMod::check(HttpRequestData* req) const {
   struct tm cur_time;



Mime
View raw message