From a79d60b8891237e011bdaad3bd1a7c1572e2f3b7 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 28 Jan 2020 14:43:08 -0800 Subject: [PATCH] client: make max_std(err/out)_file_size double File sizes should always be double, not int This fixes #3435 Signed-off-by: Vitalii Koshura --- client/log_flags.cpp | 4 ++-- lib/cc_config.cpp | 8 ++++---- lib/cc_config.h | 4 ++-- lib/diagnostics.cpp | 2 +- lib/diagnostics.h | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client/log_flags.cpp b/client/log_flags.cpp index 05d30b1649..8f2514e601 100644 --- a/client/log_flags.cpp +++ b/client/log_flags.cpp @@ -419,8 +419,8 @@ int CC_CONFIG::parse_options_client(XML_PARSER& xp) { if (xp.parse_int("max_event_log_lines", max_event_log_lines)) continue; if (xp.parse_int("max_file_xfers", max_file_xfers)) continue; if (xp.parse_int("max_file_xfers_per_project", max_file_xfers_per_project)) continue; - if (xp.parse_int("max_stderr_file_size", max_stderr_file_size)) continue; - if (xp.parse_int("max_stdout_file_size", max_stdout_file_size)) continue; + if (xp.parse_double("max_stderr_file_size", max_stderr_file_size)) continue; + if (xp.parse_double("max_stdout_file_size", max_stdout_file_size)) continue; if (xp.parse_int("max_tasks_reported", max_tasks_reported)) continue; if (xp.parse_int("ncpus", ncpus)) continue; if (xp.parse_bool("no_alt_platform", no_alt_platform)) continue; diff --git a/lib/cc_config.cpp b/lib/cc_config.cpp index f766e448d1..b48609474c 100644 --- a/lib/cc_config.cpp +++ b/lib/cc_config.cpp @@ -397,8 +397,8 @@ int CC_CONFIG::parse_options(XML_PARSER& xp) { if (xp.parse_int("max_event_log_lines", max_event_log_lines)) continue; if (xp.parse_int("max_file_xfers", max_file_xfers)) continue; if (xp.parse_int("max_file_xfers_per_project", max_file_xfers_per_project)) continue; - if (xp.parse_int("max_stderr_file_size", max_stderr_file_size)) continue; - if (xp.parse_int("max_stdout_file_size", max_stdout_file_size)) continue; + if (xp.parse_double("max_stderr_file_size", max_stderr_file_size)) continue; + if (xp.parse_double("max_stdout_file_size", max_stdout_file_size)) continue; if (xp.parse_int("max_tasks_reported", max_tasks_reported)) continue; if (xp.parse_int("ncpus", ncpus)) continue; if (xp.parse_bool("no_alt_platform", no_alt_platform)) continue; @@ -629,8 +629,8 @@ int CC_CONFIG::write(MIOFILE& out, LOG_FLAGS& log_flags) { " %d\n" " %d\n" " %d\n" - " %d\n" - " %d\n" + " %f\n" + " %f\n" " %d\n" " %d\n" " %d\n" diff --git a/lib/cc_config.h b/lib/cc_config.h index 34c6f7a4ad..442d78015b 100644 --- a/lib/cc_config.h +++ b/lib/cc_config.h @@ -172,8 +172,8 @@ struct CC_CONFIG { int max_event_log_lines; int max_file_xfers; int max_file_xfers_per_project; - int max_stderr_file_size; - int max_stdout_file_size; + double max_stderr_file_size; + double max_stdout_file_size; int max_tasks_reported; int ncpus; bool no_alt_platform; diff --git a/lib/diagnostics.cpp b/lib/diagnostics.cpp index f694ba0d42..a700c8c257 100644 --- a/lib/diagnostics.cpp +++ b/lib/diagnostics.cpp @@ -988,7 +988,7 @@ void boinc_info(const char* pszFormat, ...){ } #endif -void diagnostics_set_max_file_sizes(int stdout_size, int stderr_size) { +void diagnostics_set_max_file_sizes(double stdout_size, double stderr_size) { if (stdout_size) max_stdout_file_size = stdout_size; if (stderr_size) max_stderr_file_size = stderr_size; } diff --git a/lib/diagnostics.h b/lib/diagnostics.h index 23b8a83c42..12218b237c 100644 --- a/lib/diagnostics.h +++ b/lib/diagnostics.h @@ -104,7 +104,7 @@ extern int diagnostics_set_aborted_via_gui(void); // Log rotation extern int diagnostics_cycle_logs(void); -extern void diagnostics_set_max_file_sizes(int stdout_size, int stderr_size); +extern void diagnostics_set_max_file_sizes(double stdout_size, double stderr_size); // Thread Tracking extern int diagnostics_init_thread_list(void);