From 135390968b65d4519294564c12e428c71e9fa51a Mon Sep 17 00:00:00 2001 From: Alexander Iljin Date: Tue, 24 May 2016 20:42:48 +0300 Subject: [PATCH] Delete throw-win32-error, replace with win32-error calls --- basis/io/directories/windows/windows.factor | 2 +- basis/io/files/windows/windows.factor | 4 ++-- basis/windows/errors/errors.factor | 9 +-------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/basis/io/directories/windows/windows.factor b/basis/io/directories/windows/windows.factor index 76cc8f33f0..083c5187fb 100644 --- a/basis/io/directories/windows/windows.factor +++ b/basis/io/directories/windows/windows.factor @@ -31,7 +31,7 @@ ERROR: file-delete-failed path error ; : (delete-file) ( path -- ) dup DeleteFile 0 = [ GetLastError ERROR_ACCESS_DENIED = - [ delete-read-only-file ] [ throw-win32-error ] if + [ delete-read-only-file ] [ win32-error ] if ] [ drop ] if ; M: windows delete-file ( path -- ) diff --git a/basis/io/files/windows/windows.factor b/basis/io/files/windows/windows.factor index 933c904df1..9aa45989aa 100644 --- a/basis/io/files/windows/windows.factor +++ b/basis/io/files/windows/windows.factor @@ -117,7 +117,7 @@ M: windows init-io ( -- ) : handle>file-size ( handle -- n/f ) (handle>file-size) [ GetLastError ERROR_INVALID_FUNCTION = - [ f ] [ throw-win32-error ] if + [ f ] [ win32-error ] if ] unless* ; ERROR: seek-before-start n ; @@ -405,7 +405,7 @@ M: windows home 0 [ FindFirstStream ] keepd over INVALID_HANDLE_VALUE = [ - 2drop throw-win32-error + 2drop win32-error ] [ 1vector swap file-streams-rest ] if ; diff --git a/basis/windows/errors/errors.factor b/basis/windows/errors/errors.factor index 82e8701d16..5679a62eba 100644 --- a/basis/windows/errors/errors.factor +++ b/basis/windows/errors/errors.factor @@ -740,9 +740,6 @@ ERROR: windows-error n string ; dup n>win32-error-string windows-error ] if ; -: throw-win32-error ( -- * ) - win32-error-string throw ; - : check-invalid-handle ( handle -- handle ) dup INVALID_HANDLE_VALUE = [ win32-error ] when ; @@ -758,11 +755,7 @@ CONSTANT: expected-io-errors expected-io-errors member? ; : expected-io-error ( error-code -- ) - dup expected-io-error? [ - drop - ] [ - throw-win32-error - ] if ; + expected-io-error? [ win32-error ] unless ; : io-error ( return-value -- ) { 0 f } member? [ GetLastError expected-io-error ] when ; -- 2.34.1