Unverified Commit b21055ce authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #153 from djdv/fix/win-stdio

cli: don't sync output to NUL on Windows
parents 0dedcefc f6962d28
......@@ -6,11 +6,14 @@ import (
"syscall"
)
const invalid_file_handle syscall.Errno = 0x6
const (
invalid_file_handle syscall.Errno = 0x6 // console output is not buffered on this platform
invalid_handle_function syscall.Errno = 0x1 // this is specifically returned when NUL is the FlushFileBuffers target
)
func isErrnoNotSupported(err error) bool {
switch err {
case syscall.EINVAL, syscall.ENOTSUP, syscall.ENOTTY, invalid_file_handle:
case syscall.EINVAL, syscall.ENOTSUP, syscall.ENOTTY, invalid_file_handle, invalid_handle_function:
return true
}
return false
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment