From 4a9adfd4591ca5de96b1294cd47d12c4efc22535 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Wed, 2 Jul 2025 14:41:53 +0200 Subject: Fix cleanup handling in wait for processes forked without scsh-process Similar to the C5 code, here we assumed that proc+condition would be true if the pid-or-process argument was a raw pid number, as taken from the table maintained by scsh-process. Unfortunately, this assumption only holds when the process would've been forked using "fork" from the scsh-process egg. If one forked with the "core" fork from CHICKEN itself, both p and pending-before would be false, which would lead to a "(car) bad argument type: #f" error. Reported by Matthew Welland. --- scsh-process.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scsh-process.scm') diff --git a/scsh-process.scm b/scsh-process.scm index bcc6dbd..a438aa3 100644 --- a/scsh-process.scm +++ b/scsh-process.scm @@ -157,10 +157,11 @@ (process-id pid-or-process))))) (proc (if (process? pid-or-process) pid-or-process - (car proc+condition)))) + (and proc+condition (car proc+condition))))) (when proc+condition (mutex-unlock! m (cdr proc+condition))) (if (or (number? pid-or-process) + (not proc) (not (process-exit-status proc))) (lp) ; could be forcibly unblocked (begin -- cgit v1.2.3