mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
better fix for macos/freebsd, where writing to /dev/null does set errno, but also fwrite returns the required amount of bytes
This commit is contained in:
parent
c00f91b003
commit
ce145e57b7
1 changed files with 3 additions and 1 deletions
|
@ -342,7 +342,9 @@ pub fn (mut f File) write_full_buffer(buffer voidptr, buffer_len usize) ! {
|
||||||
if cerror == C.EINTR {
|
if cerror == C.EINTR {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
return error(posix_get_error_msg(cerror))
|
if x != buffer_len {
|
||||||
|
return error(posix_get_error_msg(cerror))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if x <= 0 {
|
if x <= 0 {
|
||||||
return error('C.fwrite returned 0')
|
return error('C.fwrite returned 0')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue