From: malc Date: Wed, 15 Jul 2009 16:52:47 +0000 (+0400) Subject: Avoid SIGSEGV when dumping cpu state without enabled logging X-Git-Tag: v0.11.0-rc0~91 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=430c7ec700bf508efadd539480f0ecaf24ca1d2c;p=thirdparty%2Fqemu.git Avoid SIGSEGV when dumping cpu state without enabled logging Signed-off-by: malc --- diff --git a/linux-user/main.c b/linux-user/main.c index e331d658fbf..1e95f02124a 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1053,7 +1053,8 @@ do { \ fprintf(stderr, fmt , ## __VA_ARGS__); \ cpu_dump_state(env, stderr, fprintf, 0); \ qemu_log(fmt, ## __VA_ARGS__); \ - log_cpu_state(env, 0); \ + if (logfile) \ + log_cpu_state(env, 0); \ } while (0) void cpu_loop(CPUPPCState *env)