Added &i/o-read, &i/o-write, and &i/o conditions to read/write
errors.
This commit is contained in:
parent
8d8f6d39f7
commit
afd7592ae1
|
@ -1197,7 +1197,7 @@
|
||||||
#| 22 |# "broken pipe (e.g., writing to a closed process or socket)"
|
#| 22 |# "broken pipe (e.g., writing to a closed process or socket)"
|
||||||
#| 23 |# "connection refused"))
|
#| 23 |# "connection refused"))
|
||||||
|
|
||||||
(define (io-error who id err)
|
(define (io-error who id err . other-conditions)
|
||||||
(let ([err (fxnot err)])
|
(let ([err (fxnot err)])
|
||||||
(let ([msg
|
(let ([msg
|
||||||
(cond
|
(cond
|
||||||
|
@ -1205,14 +1205,16 @@
|
||||||
(vector-ref io-errors-vec err)]
|
(vector-ref io-errors-vec err)]
|
||||||
[else "unknown error"])])
|
[else "unknown error"])])
|
||||||
(raise
|
(raise
|
||||||
(condition
|
(apply condition
|
||||||
(make-who-condition who)
|
(make-who-condition who)
|
||||||
|
(make-i/o-error)
|
||||||
(case err
|
(case err
|
||||||
[(6 9 18) (make-i/o-file-protection-error)]
|
[(6 9 18) (make-i/o-file-protection-error)]
|
||||||
[(19) (make-i/o-file-already-exists-error id)]
|
[(19) (make-i/o-file-already-exists-error id)]
|
||||||
[else (condition)])
|
[else (condition)])
|
||||||
(make-message-condition msg)
|
(make-message-condition msg)
|
||||||
(make-i/o-filename-error id))))))
|
(make-i/o-filename-error id)
|
||||||
|
other-conditions)))))
|
||||||
|
|
||||||
;(define block-size 4096)
|
;(define block-size 4096)
|
||||||
;(define block-size (* 4 4096))
|
;(define block-size (* 4 4096))
|
||||||
|
@ -1247,7 +1249,9 @@
|
||||||
(add-io-event fd k 'r)
|
(add-io-event fd k 'r)
|
||||||
(process-events)))
|
(process-events)))
|
||||||
(refill bv idx cnt)]
|
(refill bv idx cnt)]
|
||||||
[else (io-error 'read id bytes)])))])
|
[else
|
||||||
|
(io-error 'read id bytes
|
||||||
|
(make-i/o-write-error))])))])
|
||||||
refill)
|
refill)
|
||||||
#f ;;; write!
|
#f ;;; write!
|
||||||
#f ;;; get-position
|
#f ;;; get-position
|
||||||
|
@ -1286,7 +1290,9 @@
|
||||||
(add-io-event fd k 'w)
|
(add-io-event fd k 'w)
|
||||||
(process-events)))
|
(process-events)))
|
||||||
(refill bv idx cnt)]
|
(refill bv idx cnt)]
|
||||||
[else (io-error 'write id bytes)])))])
|
[else
|
||||||
|
(io-error 'write id bytes
|
||||||
|
(make-i/o-write-error))])))])
|
||||||
refill)
|
refill)
|
||||||
#f ;;; get-position
|
#f ;;; get-position
|
||||||
#f ;;; set-position!
|
#f ;;; set-position!
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
1434
|
1435
|
||||||
|
|
Loading…
Reference in New Issue