From edca32b5b56805c926422764c61c33185293fb2f Mon Sep 17 00:00:00 2001 From: chaojixx Date: Fri, 6 Dec 2019 11:52:04 -0500 Subject: [PATCH] libcpu log: redirect the stdout to file Signed-off-by: chaojixx --- src/s2e-kvm.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/s2e-kvm.cpp b/src/s2e-kvm.cpp index 391645a..ea3d012 100644 --- a/src/s2e-kvm.cpp +++ b/src/s2e-kvm.cpp @@ -287,7 +287,8 @@ void S2EKVM::initLogLevel(void) { const char *libcpu_log_file = getenv("LIBCPU_LOG_FILE"); if (libcpu_log_file) { - logfile = fopen(libcpu_log_file, "w"); + //logfile = fopen(libcpu_log_file, "w"); + logfile = freopen(libcpu_log_file, "w", stdout); if (!logfile) { printf("Could not open log file %s\n", libcpu_log_file); exit(-1);