Begin mapping os.Error in the rest of the codebase
This commit is contained in:
1 parent
1d75a612d5
commit
97c499dbb4
18 files changed
+231
-222
No files matched your search
@@ -12,7 +12,7 @@ MAX_RW :: 1<<30
|
||||
@(no_instrumentation)
|
||||
_write :: proc "contextless" (fd: os.Handle, data: []byte) -> (int, os.Error) #no_bounds_check /* bounds check would segfault instrumentation */ {
|
||||
if len(data) == 0 {
|
||||
return 0, os.ERROR_NONE
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
single_write_length: win32.DWORD
|
||||
@@ -25,12 +25,11 @@ _write :: proc "contextless" (fd: os.Handle, data: []byte) -> (int, os.Error) #n
|
||||
|
||||
e := win32.WriteFile(win32.HANDLE(fd), &data[total_write], to_write, &single_write_length, nil)
|
||||
if single_write_length <= 0 || !e {
|
||||
err := os.Platform_Error(win32.GetLastError())
|
||||
return int(total_write), err
|
||||
return int(total_write), os.get_last_error()
|
||||
}
|
||||
total_write += i64(single_write_length)
|
||||
}
|
||||
return int(total_write), os.ERROR_NONE
|
||||
return int(total_write), nil
|
||||
}
|
||||
|
||||
@(no_instrumentation)
|
||||
|
||||
Reference in new issue
Block a user