| Submitter | Ian Taylor |
|---|---|
| Date | Jan. 28, 2011, 12:01 a.m. |
| Message ID | <mcr39odoq0p.fsf@google.com> |
| Download | mbox | patch |
| Permalink | /patch/80756/ |
| State | New |
| Headers | show |
Comments
Patch
diff -r 0002fbcf1cf0 libgo/go/os/file_unix.go --- a/libgo/go/os/file_unix.go Thu Jan 27 15:27:40 2011 -0800 +++ b/libgo/go/os/file_unix.go Thu Jan 27 15:59:07 2011 -0800 @@ -47,6 +47,13 @@ if e := syscall.Close(file.fd); e != 0 { err = &PathError{"close", file.name, Errno(e)} } + + if file.dirinfo != nil { + if libc_closedir(file.dirinfo.dir) < 0 && err == nil { + err = &PathError{"closedir", file.name, Errno(syscall.GetErrno())} + } + } + file.fd = -1 // so it can't be closed again // no need for a finalizer anymore