You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2018/08/03 21:09:22 UTC

[trafficserver] branch master updated: fix outputlog, diagslog rolling size overflow

This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 894c2ae  fix outputlog, diagslog rolling size overflow
894c2ae is described below

commit 894c2ae86532b792a45373848c9c2f4e913de36e
Author: Shinya Kawano <sk...@yahoo-corp.jp>
AuthorDate: Thu Jul 26 16:46:54 2018 +0900

    fix outputlog, diagslog rolling size overflow
---
 lib/ts/Diags.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/ts/Diags.cc b/lib/ts/Diags.cc
index 005e2f5..4c19164 100644
--- a/lib/ts/Diags.cc
+++ b/lib/ts/Diags.cc
@@ -600,8 +600,8 @@ Diags::should_roll_diagslog()
         return false;
       }
 
-      int size = buf.st_size;
-      if (diagslog_rolling_size != -1 && size >= (diagslog_rolling_size * BYTES_IN_MB)) {
+      off_t size = buf.st_size;
+      if (diagslog_rolling_size != -1 && size >= (static_cast<off_t>(diagslog_rolling_size) * BYTES_IN_MB)) {
         fflush(diags_log->m_fp);
         if (diags_log->roll()) {
           char *oldname = ats_strdup(diags_log->get_name());
@@ -687,8 +687,8 @@ Diags::should_roll_outputlog()
         return false;
       }
 
-      int size = buf.st_size;
-      if (outputlog_rolling_size != -1 && size >= outputlog_rolling_size * BYTES_IN_MB) {
+      off_t size = buf.st_size;
+      if (outputlog_rolling_size != -1 && size >= static_cast<off_t>(outputlog_rolling_size) * BYTES_IN_MB) {
         // since usually stdout and stderr are the same file on disk, we should just
         // play it safe and just flush both BaseLogFiles
         if (stderr_log->is_init()) {