From: Alex Rousskov Date: Wed, 14 Sep 2011 19:59:30 +0000 (-0600) Subject: Fixed negative time value detection and removed "pointless comparison with 0" X-Git-Tag: BumpSslServerFirst.take01~156 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=609fdb04bb544c7778b150d3fe261336b2eef557;p=thirdparty%2Fsquid.git Fixed negative time value detection and removed "pointless comparison with 0" to make ICC compiler happier. --- diff --git a/src/fs/rock/RockSwapDir.cc b/src/fs/rock/RockSwapDir.cc index 898e0099f2..b580f0b4d7 100644 --- a/src/fs/rock/RockSwapDir.cc +++ b/src/fs/rock/RockSwapDir.cc @@ -310,13 +310,15 @@ Rock::SwapDir::parseTimeOption(char const *option, const char *value, int reconf if (!value) self_destruct(); - const time_msec_t newTime = strtoll(value, NULL, 10); - - if (newTime < 0) { - debugs(3, DBG_CRITICAL, "FATAL: cache_dir " << path << ' ' << option << " must not be negative but is: " << newTime); + // TODO: handle time units and detect parsing errors better + const int64_t parsedValue = strtoll(value, NULL, 10); + if (parsedValue < 0) { + debugs(3, DBG_CRITICAL, "FATAL: cache_dir " << path << ' ' << option << " must not be negative but is: " << parsedValue); self_destruct(); } + const time_msec_t newTime = static_cast(parsedValue); + if (reconfiguring && *storedTime != newTime) debugs(3, DBG_IMPORTANT, "cache_dir " << path << ' ' << option << " is now " << newTime);