From 03ae1481fb121f07f6cb5dee73e6d4c781c5ebe1 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Wed, 29 Jul 2020 13:16:44 +0200 Subject: [PATCH] Don't open an error dialog in headless mode --- rpcs3/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rpcs3/main.cpp b/rpcs3/main.cpp index 9cdfe3300a..8d2155269e 100644 --- a/rpcs3/main.cpp +++ b/rpcs3/main.cpp @@ -48,6 +48,7 @@ inline std::string sstr(const QString& _in) { return _in.toStdString(); } static semaphore<> s_qt_init; +static atomic_t s_headless = false; static atomic_t s_argv0; #ifndef _WIN32 @@ -58,6 +59,12 @@ LOG_CHANNEL(sys_log, "SYS"); [[noreturn]] extern void report_fatal_error(const std::string& text) { + if (s_headless) + { + fprintf(stderr, "RPCS3: %s\n", text.c_str()); + return; + } + const bool local = s_qt_init.try_lock(); // Possibly created and assigned here @@ -438,6 +445,7 @@ int main(int argc, char** argv) } else if (auto headless_app = qobject_cast(app.data())) { + s_headless = true; headless_app->Init(); }