From f6962d28bfe2d692bcfe345caac56333cc57e772 Mon Sep 17 00:00:00 2001 From: Dominic Della Valle Date: Mon, 4 Mar 2019 14:11:25 -0500 Subject: [PATCH] cli: don't sync output to NUL on Windows fixes ipfs/go-ipfs#6039 --- cli/error_windows.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cli/error_windows.go b/cli/error_windows.go index f29994a7..0a2d9a31 100644 --- a/cli/error_windows.go +++ b/cli/error_windows.go @@ -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