diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-12-06 02:00:13 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-12-06 02:00:13 +0000 |
commit | 4d901dd7357b5e4150026548449166ebd5edd48f (patch) | |
tree | cc71dfa39df4e1b16b96f13ad38293dbc9f135e7 /libgo/go/os/file_unix.go | |
parent | d6981042607499e6e3f1b134d4b8cd969840b288 (diff) | |
download | gcc-4d901dd7357b5e4150026548449166ebd5edd48f.zip gcc-4d901dd7357b5e4150026548449166ebd5edd48f.tar.gz gcc-4d901dd7357b5e4150026548449166ebd5edd48f.tar.bz2 |
os: Clean up directory reading code.
From-SVN: r194237
Diffstat (limited to 'libgo/go/os/file_unix.go')
-rw-r--r-- | libgo/go/os/file_unix.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libgo/go/os/file_unix.go b/libgo/go/os/file_unix.go index f677dbb..68f4be8 100644 --- a/libgo/go/os/file_unix.go +++ b/libgo/go/os/file_unix.go @@ -108,8 +108,13 @@ func (file *file) close() error { } if file.dirinfo != nil { - if libc_closedir(file.dirinfo.dir) < 0 && err == nil { - err = &PathError{"closedir", file.name, syscall.GetErrno()} + syscall.Entersyscall() + i := libc_closedir(file.dirinfo.dir) + errno := syscall.GetErrno() + syscall.Exitsyscall() + file.dirinfo = nil + if i < 0 && err == nil { + err = &PathError{"closedir", file.name, errno} } } |