summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Bex <peter@more-magic.net>2025-05-02 09:18:05 +0200
committerPeter Bex <peter@more-magic.net>2025-05-02 09:18:05 +0200
commit6785fa1fc13bcdcaf0bc61d4ee4e0454cba8b154 (patch)
tree09a63f60d0d5765f616d75d93f486eb9fc124ca3
parente520d20700e513d69c5c83a03b48d89f4194fe63 (diff)
downloadscsh-process-1.6.1.tar.gz
Return 0 from original process-wait if the process is still running1.6.1
-rw-r--r--scsh-process.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/scsh-process.scm b/scsh-process.scm
index af3586e..b3f7fd1 100644
--- a/scsh-process.scm
+++ b/scsh-process.scm
@@ -124,7 +124,11 @@
(let ((posix-process-wait process-wait))
(set! process-wait
(lambda (#!optional pid nohang)
- (receive (status ok? pid) (wait pid nohang) (values pid ok? status))))
+ (receive (status ok? pid) (wait pid nohang)
+ ;; NOTE: If nohang is true, if the pid returned by
+ ;; posix-process-wait is zero, our implementation will
+ ;; return #f. This emulates the original behaviour:
+ (values (or pid 0) ok? status))))
(set! wait
(lambda (#!optional pid-or-process nohang)