From c3a277e23294abaca2c0a802959a20159cacb8b4 Mon Sep 17 00:00:00 2001 From: blankie Date: Mon, 20 Feb 2023 16:20:36 +0700 Subject: [PATCH] Immediately exit if execlp()/dup2() failed --- logcat_thread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logcat_thread.cpp b/logcat_thread.cpp index 19d5a50..d7a0812 100644 --- a/logcat_thread.cpp +++ b/logcat_thread.cpp @@ -289,7 +289,7 @@ bool LogcatThread::_handle_start_request() { } catch (const std::exception& e) { print_log({time(nullptr), e.what()}); } - exit(1); + _exit(1); }; auto close_or_warn = [](int fd) { if (!close(fd)) { @@ -329,7 +329,7 @@ bool LogcatThread::_handle_start_request() { } catch (const std::exception& e) { print_log({time(nullptr), e.what()}); } - exit(1); + _exit(1); } else { this->logcat_process_running.test_and_set(); return true;