Clean up message mode pipe handling, add test

This commit is contained in:
John Starks
2018-06-25 09:31:55 -07:00
parent 3f914f36b8
commit 3eabd1969d
3 changed files with 68 additions and 16 deletions
-3
View File
@@ -229,9 +229,6 @@ func (f *win32File) Read(b []byte) (int, error) {
return 0, io.EOF
} else if err == syscall.ERROR_BROKEN_PIPE {
return 0, io.EOF
// When there is more data in the message pipe to read, we get ERROR_MORE_DATA. We ignore that error and proceed to read more data
} else if err == syscall.ERROR_MORE_DATA && n != 0 && len(b) != 0 {
return n, nil
} else {
return n, err
}