io-error and raise/strerr now include an &error condition.

This commit is contained in:
Abdulaziz Ghuloum 2008-06-06 08:10:17 -07:00
parent af5472bfb2
commit df4b31af1f
3 changed files with 24 additions and 19 deletions

View File

@ -1186,11 +1186,15 @@
(eof-object? (lookahead-u8 p)))] (eof-object? (lookahead-u8 p)))]
[else (die 'port-eof? "not an input port" p)]))) [else (die 'port-eof? "not an input port" p)])))
;;; FIXME: these hard coded constants should go away
(define EAGAIN-error-code -6) ;;; from ikarus-errno.c (define EAGAIN-error-code -6) ;;; from ikarus-errno.c
(define (io-error who id err . other-conditions) (define io-error
(case-lambda
[(who id err base-condition)
(raise (raise
(apply condition (condition
base-condition
(make-who-condition who) (make-who-condition who)
(make-message-condition (strerror err)) (make-message-condition (strerror err))
(case err (case err
@ -1204,8 +1208,8 @@
[(-45) (make-i/o-file-does-not-exist-error id)] [(-45) (make-i/o-file-does-not-exist-error id)]
[else (if id [else (if id
(make-irritants-condition (list id)) (make-irritants-condition (list id))
(condition))]) (condition))])))]
other-conditions))) [(who id err) (io-error who id err (make-error))]))
;(define block-size 4096) ;(define block-size 4096)
;(define block-size (* 4 4096)) ;(define block-size (* 4 4096))

View File

@ -260,6 +260,7 @@
[(who errno-code filename) [(who errno-code filename)
(raise (raise
(condition (condition
(make-error)
(make-who-condition who) (make-who-condition who)
(make-message-condition (strerror errno-code)) (make-message-condition (strerror errno-code))
(if filename (if filename

View File

@ -1 +1 @@
1499 1500