diff --git a/mes/module/mes/posix.mes b/mes/module/mes/posix.mes index ae6288f7..3f081d5b 100644 --- a/mes/module/mes/posix.mes +++ b/mes/module/mes/posix.mes @@ -57,3 +57,6 @@ (define (waitpid pid . options) (let ((options (if (null? options) 0 (car options)))) (core:waitpid pid options))) + +(define (status:exit-val status) + (ash status -8)) diff --git a/module/mescc/mescc.scm b/module/mescc/mescc.scm index be06d943..e3d93a1e 100644 --- a/module/mescc/mescc.scm +++ b/module/mescc/mescc.scm @@ -281,7 +281,7 @@ (let ((status (apply system* args))) (when (not (zero? status)) (stderr "mescc: failed: ~a\n" (string-join args)) - (exit status)) + (exit (status:exit-val status))) status)) (define (multi-opt option-name) (lambda (o) (and (eq? (car o) option-name) (cdr o))))