From 288d5c4ac32c27704258a15d365a56dadf38b0e9 Mon Sep 17 00:00:00 2001 From: Mark Leyva Date: Mon, 1 Jul 2024 02:42:11 -0700 Subject: fixes #5091; Ensure we don't wait on an exited process on Linux (#23743) Fixes #5091. Ensure we don't wait on an exited process on Linux --- lib/pure/osproc.nim | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 9284e823a..e88680463 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -1416,6 +1416,8 @@ elif not defined(useNimRtl): tmspec.tv_nsec = (timeout * 1_000_000) try: + if not running(p): + return exitStatusLikeShell(p.exitStatus) if clock_gettime(CLOCK_REALTIME, stspec) == -1: raiseOSError(osLastError()) while true: -- cgit 1.4.1-2-gfad0