From 959ef7a7374de067b21ccfe4d403082641008811 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 7 Feb 2009 11:24:12 -0600 Subject: [PATCH] better error handling for backends --- basis/io/backend/unix/unix.factor | 1 + basis/io/backend/windows/nt/nt.factor | 1 + 2 files changed, 2 insertions(+) diff --git a/basis/io/backend/unix/unix.factor b/basis/io/backend/unix/unix.factor index e39ae3e7f8..3372f15cd9 100644 --- a/basis/io/backend/unix/unix.factor +++ b/basis/io/backend/unix/unix.factor @@ -51,6 +51,7 @@ M: unix (stream-seek) ( n seek-type stream -- ) { io:seek-absolute [ SEEK_SET ] } { io:seek-relative [ SEEK_CUR ] } { io:seek-end [ SEEK_END ] } + [ io:bad-seek-type ] } case [ handle>> fd>> swap ] dip lseek io-error ; diff --git a/basis/io/backend/windows/nt/nt.factor b/basis/io/backend/windows/nt/nt.factor index 7479c0a0bb..7b96e883dd 100755 --- a/basis/io/backend/windows/nt/nt.factor +++ b/basis/io/backend/windows/nt/nt.factor @@ -92,6 +92,7 @@ M: winnt (stream-seek) ( n seek-type stream -- ) { seek-absolute [ handle>> (>>ptr) ] } { seek-relative [ handle>> [ + ] change-ptr drop ] } { seek-end [ handle>> [ handle>> handle>file-size + ] keep (>>ptr) ] } + [ bad-seek-type ] } case ; : file-error? ( n -- eof? )