From 4f9f8ebcf6369a3bd7737ed40ff77a4bb1abee51 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Mon, 26 Dec 2022 10:26:22 -0800 Subject: [PATCH] fix unused return value warning --- library/Core.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/Core.cpp b/library/Core.cpp index e5fe61771..5b53db98f 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -1483,10 +1483,12 @@ bool Core::Init() // Don't do this on Linux because it will break PRINT_MODE:TEXT // this is handled as appropriate in Console-posix.cpp fprintf(stdout, "dfhack: redirecting stdout to stdout.log (again)\n"); - freopen("stdout.log", "w", stdout); + if (!freopen("stdout.log", "w", stdout)) + cerr << "Could not redirect stdout to stdout.log" << endl; #endif fprintf(stderr, "dfhack: redirecting stderr to stderr.log\n"); - freopen("stderr.log", "w", stderr); + if (!freopen("stderr.log", "w", stderr)) + cerr << "Could not redirect stderr to stderr.log" << endl; Filesystem::init();