diff options
Diffstat (limited to 'base/perftimer.cc')
-rw-r--r-- | base/perftimer.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/base/perftimer.cc b/base/perftimer.cc index 1231923..9fc0328 100644 --- a/base/perftimer.cc +++ b/base/perftimer.cc @@ -2,11 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <stdio.h> - #include "base/perftimer.h" +#include <stdio.h> +#include <string> + #include "base/basictypes.h" +#include "base/file_util.h" #include "base/logging.h" static FILE* perf_log_file = NULL; @@ -18,12 +20,8 @@ bool InitPerfLog(const char* log_file) { return false; } -#if defined(OS_WIN) - return fopen_s(&perf_log_file, log_file, "w") == 0; -#elif defined(OS_POSIX) - perf_log_file = fopen(log_file, "w"); + perf_log_file = file_util::OpenFile(std::string(log_file), "w"); return perf_log_file != NULL; -#endif } void FinalizePerfLog() { @@ -32,7 +30,7 @@ void FinalizePerfLog() { NOTREACHED(); return; } - fclose(perf_log_file); + file_util::CloseFile(perf_log_file); } void LogPerfResult(const char* test_name, double value, const char* units) { |