diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-02-18 09:50:58 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-02-18 09:50:58 +0100 |
commit | c072558b90f1bbedc2022b0f30c8b1ac4712538e (patch) | |
tree | 67767591619e4bd8111fb05fac185cde94fb7378 /src/pkg/os/file_windows.go | |
parent | 5859517b767c99749a45651c15d4bae5520ebae8 (diff) | |
download | golang-upstream/2011.02.15.tar.gz |
Imported Upstream version 2011.02.15upstream/2011.02.15
Diffstat (limited to 'src/pkg/os/file_windows.go')
-rw-r--r-- | src/pkg/os/file_windows.go | 9 |
1 files changed, 5 insertions, 4 deletions
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 |