From c6132f65cc00ceac98ad6d6ddcb48fcde709eede Mon Sep 17 00:00:00 2001 From: Misha Chornyi Date: Thu, 9 May 2024 21:10:16 -0700 Subject: [PATCH] =?UTF-8?q?Add=20error=20handling=20in=20case=20of=20Autoc?= =?UTF-8?q?ompleteStub=20Failure=20for=20DLIS-5819=20=E2=80=A6=20#357?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stub_launcher.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/stub_launcher.cc b/src/stub_launcher.cc index 9dc2a64a..828228e6 100644 --- a/src/stub_launcher.cc +++ b/src/stub_launcher.cc @@ -787,7 +787,11 @@ StubLauncher::WaitForStubProcess() CloseHandle(stub_pid_.hThread); #else int status; - waitpid(stub_pid_, &status, 0); + if (stub_pid_ != 0) { + // Added this check to ensure server doesn't hang waiting after stub + // process has already be killed and cannot be waited on + waitpid(stub_pid_, &status, 0); + } #endif }