trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [trafficserver] branch master updated: fix outputlog, diagslog rolling size overflow
Date Fri, 03 Aug 2018 21:09:22 GMT
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 <skawano@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()) {


Mime
View raw message