Minor fix to os.write on darwin
This commit is contained in:
1 parent
d9647174a3
commit
9b4d4a2c61
1 file changed
+3
@@ -169,6 +169,9 @@ close :: proc(fd: Handle) {
|
||||
write :: proc(fd: Handle, data: []u8) -> (int, Errno) {
|
||||
assert(fd != -1);
|
||||
|
||||
if len(data) == 0 {
|
||||
return 0, 1;
|
||||
}
|
||||
bytes_written := _unix_write(fd, &data[0], len(data));
|
||||
if(bytes_written == -1) {
|
||||
return 0, 1;
|
||||
|
||||
Reference in new issue
Block a user