From 4d244dee968193961ea3c4ab04c3ecc1680c47fc Mon Sep 17 00:00:00 2001 From: David Carlier Date: Thu, 30 Mar 2023 07:58:59 +0100 Subject: [PATCH] pte: pte_osThreadWaitForEnd checking return of Sys::waitpid close #165 --- src/platform/pte.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/pte.rs b/src/platform/pte.rs index 13bf4bbd48..a75d5cc014 100644 --- a/src/platform/pte.rs +++ b/src/platform/pte.rs @@ -233,7 +233,9 @@ pub unsafe extern "C" fn pte_osThreadDelete(handle: pte_osThreadHandle) -> pte_o #[no_mangle] pub unsafe extern "C" fn pte_osThreadWaitForEnd(handle: pte_osThreadHandle) -> pte_osResult { let mut status = 0; - Sys::waitpid(handle, &mut status, 0); + if Sys::waitpid(handle, &mut status, 0) < 0 { + return PTE_OS_GENERAL_FAILURE; + } PTE_OS_OK }