]> gitweb.factorcode.org Git - factor.git/commitdiff
io: fix for win32-error not throwing on zero.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 6 Jan 2020 22:20:15 +0000 (14:20 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 6 Jan 2020 22:20:15 +0000 (14:20 -0800)
basis/io/directories/windows/windows.factor
basis/io/files/info/windows/windows.factor
basis/io/files/windows/windows.factor
basis/io/sockets/secure/windows/windows.factor

index 083c5187fb6634ef26a69a9a1be897847655a076..b06a5bf1e1eccd407f6280a6e6a0f798785e5871 100644 (file)
@@ -31,7 +31,7 @@ ERROR: file-delete-failed path error ;
 : (delete-file) ( path -- )
     dup DeleteFile 0 = [
         GetLastError ERROR_ACCESS_DENIED =
-        [ delete-read-only-file ] [ win32-error ] if
+        [ delete-read-only-file ] [ drop win32-error ] if
     ] [ drop ] if ;
 
 M: windows delete-file ( path -- )
index 99eccd1c0f7c94da2bee3515a2c3a3acaf3cdfb0..88fa83a745ac1006105755fe1968d7a74d0a7820 100644 (file)
@@ -19,7 +19,7 @@ TUPLE: windows-file-info < file-info-tuple attributes ;
 
 : get-compressed-file-size ( path -- n )
     { DWORD } [ GetCompressedFileSize ] with-out-parameters
-    over INVALID_FILE_SIZE = [ win32-error ] [ >64bit ] if ;
+    over INVALID_FILE_SIZE = [ win32-error ] when >64bit ;
 
 : set-windows-size-on-disk ( file-info path -- file-info )
     over attributes>> +compressed+ swap member? [
index 19c08cb3a86373882ab7bdbec2005a207b2ddcbd..2bdb64cbfbabafc57f019fe673416ab5dc1d1925 100644 (file)
@@ -117,7 +117,7 @@ M: windows init-io ( -- )
 : handle>file-size ( handle -- n/f )
     (handle>file-size) [
         GetLastError ERROR_INVALID_FUNCTION =
-        [ f ] [ win32-error ] if
+        [ win32-error ] unless f
     ] unless* ;
 
 ERROR: seek-before-start n ;
@@ -405,7 +405,7 @@ M: windows home
     0
     [ FindFirstStream ] keepd
     over INVALID_HANDLE_VALUE = [
-        2drop win32-error
+        2drop win32-error f
     ] [
         1vector swap file-streams-rest
     ] if ;
index c1b8e3936d6d0382ec46b0ef3b2508ac42eb7c5f..815200c11b89157e2e98be56c709ff9373e93b93 100644 (file)
@@ -14,7 +14,7 @@ M: openssl ssl-certificate-verification-supported? f ;
 
 : load-windows-cert-store ( string -- HCERTSTORE )
     [ f ] dip CertOpenSystemStore
-    [ win32-error ] when-zero ;
+    [ win32-error ] when-zero ;
 
 : X509-NAME. ( X509_NAME -- )
     f 0 X509_NAME_oneline