diff --git a/scsh/procobj.scm b/scsh/procobj.scm index 5849ab1..64008c1 100644 --- a/scsh/procobj.scm +++ b/scsh/procobj.scm @@ -55,7 +55,7 @@ ;;; Is X a pid or a proc? -(define (pid/proc? x) (or (proc? x) (and (integer? x) (>= pid 0)))) +(define (pid/proc? x) (or (proc? x) (and (integer? x) (>= x 0)))) ;;; Process reaping @@ -296,13 +296,12 @@ (define reaped-procs '()) ; Reaped, but not yet waited. (define (filter-weak-ptr-list pred lis) - (reverse (reduce (lambda (result wptr) - (let ((val (weak-pointer-ref wptr))) - (if (and val (pred val)) - (cons wptr result) - result))) - '() - lis))) + (foldr (lambda (wptr result) (let ((val (weak-pointer-ref wptr))) + (if (and val (pred val)) + (cons wptr result) + result))) + '() + list)) ;;; Add a newly-reaped proc to the list. (define (add-reaped-proc! pid status)