diff --git a/checkin_notes b/checkin_notes index 906c9f8a64..72c1197f07 100644 --- a/checkin_notes +++ b/checkin_notes @@ -12029,3 +12029,13 @@ Rom 2 Dec 2007 win_build/installerv2/redist/Windows/x64/ boinccas.dll boinccas95.dll + +Rom 2 Dec 2007 + - CC: Move time_stats file creatio logic so that it is + created during gstate.init() instead of at class + creation time. This way time_stats.log ends up in + the data directory. + + client/ + client_state.C + time_stats.C, .h diff --git a/client/client_state.C b/client/client_state.C index b59e6156ed..c4c04547ab 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -166,6 +166,7 @@ int CLIENT_STATE::init() { scheduler_op->url_random = drand(); detect_platforms(); + time_stats.start(); msg_printf( NULL, MSG_INFO, "Starting BOINC client version %d.%d.%d for %s%s", diff --git a/client/time_stats.C b/client/time_stats.C index 45ef3867b9..91cc58de22 100644 --- a/client/time_stats.C +++ b/client/time_stats.C @@ -65,10 +65,7 @@ TIME_STATS::TIME_STATS() { previous_connected_state = CONNECTED_STATE_UNINITIALIZED; inactive_start = 0; trim_stats_log(); - time_stats_log = fopen(TIME_STATS_LOG, "a"); - if (time_stats_log) { - setbuf(time_stats_log, 0); - } + time_stats_log = NULL; } // if log file is over a meg, discard everything older than a year @@ -276,6 +273,13 @@ int TIME_STATS::parse(MIOFILE& in) { return ERR_XML_PARSE; } +void TIME_STATS::start() { + time_stats_log = fopen(TIME_STATS_LOG, "a"); + if (time_stats_log) { + setbuf(time_stats_log, 0); + } +} + void TIME_STATS::quit() { log_append("power_off", gstate.now); } diff --git a/client/time_stats.h b/client/time_stats.h index 685a91effd..06f49c6747 100644 --- a/client/time_stats.h +++ b/client/time_stats.h @@ -60,6 +60,7 @@ public: void log_append_net(int); void trim_stats_log(); void get_log_after(double, MIOFILE&); + void start(); void quit(); };