summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Bex <peter@more-magic.net>2012-10-06 20:44:25 +0200
committerPeter Bex <peter@more-magic.net>2012-10-06 20:44:25 +0200
commitd3632562d67912da68b57f92d897d5e69c80e1d1 (patch)
tree02b344f0077426f8ddc86bde2f229ce8c332837d
parent25796af52e67401f1e7003f6c70fede8966e6b05 (diff)
downloadscsh-process-d3632562d67912da68b57f92d897d5e69c80e1d1.tar.gz
Return #f from WAIT when nohang is given and the process hasn't completed
-rw-r--r--scsh-process.scm13
1 files changed, 7 insertions, 6 deletions
diff --git a/scsh-process.scm b/scsh-process.scm
index b39543f..538c82d 100644
--- a/scsh-process.scm
+++ b/scsh-process.scm
@@ -108,12 +108,13 @@
(abort exn))
(receive (pid ok? status)
(posix-process-wait (and p (scsh-process-pid p)) nohang)
- (unless (zero? pid)
- (when p
- (scsh-process-exit-status-set! p status)
- (scsh-process-ok?-set! p ok?))
- (remove-scsh-pending-process! pid))
- (values status ok? pid)))))))
+ (if (zero? pid)
+ (begin (when p
+ (scsh-process-exit-status-set! p status)
+ (scsh-process-ok?-set! p ok?))
+ (remove-scsh-pending-process! pid)
+ (values status ok? pid))
+ (values #f #f #f))))))))
(set-signal-handler!
signal/chld