--- slib.scm.~1.41.~ 2004-01-04 07:14:41.000000000 +1000 +++ slib.scm 2004-01-07 09:52:19.000000000 +1000 @@ -246,6 +246,27 @@ (define >? >) (define >=? >=) +;;; {system} +;;; + +;; If the program run is killed by a signal, the shell normally gives an +;; exit code of 128+signum. If the shell itself is killed by a signal then +;; we do the same 128+signum here. +;; +;; "stop-sig" shouldn't arise here, since system shouldn't be calling +;; waitpid with WUNTRACED, but allow for it anyway, just in case. +;; +(if (defined? 'system) + (define-public system + (let ((core-system system)) + (lambda (str) + (let ((st (core-system str))) + (cond ((status:exit-val st) + => noop) + (else + (+ 128 (or (status:term-sig st) + (status:stop-sig st)))))))))) + ;;; {Time} ;;;