Commits

Peter Bex committed de79304

Return #f from WAIT when nohang is given and the process hasn't completed

Comments (0)

Files changed (1)

                       (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