From c072558b90f1bbedc2022b0f30c8b1ac4712538e Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Fri, 18 Feb 2011 09:50:58 +0100 Subject: Imported Upstream version 2011.02.15 --- src/pkg/os/file_windows.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/pkg/os/file_windows.go') diff --git a/src/pkg/os/file_windows.go b/src/pkg/os/file_windows.go index bf710bb67..d14c38e17 100644 --- a/src/pkg/os/file_windows.go +++ b/src/pkg/os/file_windows.go @@ -83,9 +83,9 @@ func (file *File) Close() Error { } var e int if file.isdir() { - _, e = syscall.FindClose(int32(file.fd)) + e = syscall.FindClose(int32(file.fd)) } else { - _, e = syscall.CloseHandle(int32(file.fd)) + e = syscall.CloseHandle(int32(file.fd)) } var err Error if e != 0 { @@ -100,7 +100,8 @@ func (file *File) Close() Error { func (file *File) statFile(name string) (fi *FileInfo, err Error) { var stat syscall.ByHandleFileInformation - if ok, e := syscall.GetFileInformationByHandle(int32(file.fd), &stat); !ok { + e := syscall.GetFileInformationByHandle(int32(file.fd), &stat) + if e != 0 { return nil, &PathError{"stat", file.name, Errno(e)} } return fileInfoFromByHandleInfo(new(FileInfo), file.name, &stat), nil @@ -142,7 +143,7 @@ func (file *File) Readdir(count int) (fi []FileInfo, err Error) { if di.usefirststat { di.usefirststat = false } else { - _, e := syscall.FindNextFile(int32(file.fd), &di.stat.Windata) + e := syscall.FindNextFile(int32(file.fd), &di.stat.Windata) if e != 0 { if e == syscall.ERROR_NO_MORE_FILES { break -- cgit v1.2.3