os-posix: Use qemu_log_enabled

Do not reference qemu_logfile directly;
use the predicate provided by qemu/log.h.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220417183019.755276-6-richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2022-04-17 11:29:45 -07:00
parent c5955f4ff4
commit 229ef2eb44

View file

@ -291,7 +291,7 @@ void os_setup_post(void)
dup2(fd, 0);
dup2(fd, 1);
/* In case -D is given do not redirect stderr to /dev/null */
if (!qemu_logfile) {
if (!qemu_log_enabled()) {
dup2(fd, 2);
}