From 8ce0551795bd4771d4d9b8a24c301d67bfd3e3dd Mon Sep 17 00:00:00 2001 From: marting Date: Mon, 17 Jul 2000 13:15:45 +0000 Subject: [PATCH] Changed the representation of scsh-conditions to the exception os-error so it may be throwen from C. --- scsh/scsh-condition.scm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/scsh/scsh-condition.scm b/scsh/scsh-condition.scm index 145f8b7..038ab84 100644 --- a/scsh/scsh-condition.scm +++ b/scsh/scsh-condition.scm @@ -9,19 +9,26 @@ (define (errno-error errno syscall . stuff) (let ((msg (errno-msg errno))) - (apply signal 'syscall-error errno msg syscall stuff))) - + (apply (structure-ref exceptions signal-exception) + (enum op call-external-value) (enum exception os-error) + syscall errno msg stuff))) (define (with-errno-handler* handler thunk) (with-handler (lambda (condition more) - (if (syscall-error? condition) - (let ((stuff (condition-stuff condition))) - (handler (car stuff) ; errno - (cdr stuff)))) ; (msg syscall . packet) + (if (and (exception? condition) (eq? (exception-reason condition) + 'os-error)) + (let ((stuff (exception-arguments condition))) + (handler (cadr stuff) ; errno + (list (caddr stuff) ;msg + (car stuff) ;syscall + (cdddr stuff) ;packet + )))) ; (msg syscall . packet) (more)) thunk)) + + ;;; (with-errno-handler ;;; ((errno data) ; These are vars bound in this scope. ;;; ((errno/exist) . body1)