Replace err != 0 with err != nil where possible

This commit is contained in:
gingerBill
2024-08-04 14:57:25 +01:00
parent fc10b781af
commit 93fabf8628
6 changed files with 18 additions and 34 deletions
+2 -11
View File
@@ -11,20 +11,11 @@ MAX_RW :: 0x7fffffff
@(no_instrumentation)
_write :: proc "contextless" (fd: os.Handle, data: []byte) -> (n: int, err: os.Error) #no_bounds_check /* bounds check would segfault instrumentation */ {
if len(data) == 0 {
return 0, nil
}
for n < len(data) {
chunk := data[:min(len(data), MAX_RW)]
written, errno := linux.write(linux.Fd(fd), chunk)
if errno != nil {
return n, os.Platform_Error(errno)
}
n += written
n += linux.write(linux.Fd(fd), chunk) or_return
}
return n, nil
return
}
CLOCK_MONOTONIC_RAW :: 4 // NOTE(tetra): "RAW" means: Not adjusted by NTP.