]> Cypherpunks repositories - gostls13.git/commitdiff
fix Getdirentries: base comes back in r2.
authorRob Pike <r@golang.org>
Tue, 10 Feb 2009 04:04:36 +0000 (20:04 -0800)
committerRob Pike <r@golang.org>
Tue, 10 Feb 2009 04:04:36 +0000 (20:04 -0800)
R=rsc
DELTA=3  (3 added, 0 deleted, 0 changed)
OCL=24727
CL=24727

src/lib/syscall/file_darwin.go

index 5d128f743ce4d38ea6a04565a9baf09d2b912b7f..c1e43c31ffa1e3d1bc8b038d14be0fe0cfd59019 100644 (file)
@@ -96,5 +96,8 @@ func Dup2(fd1, fd2 int64) (ret int64, errno int64) {
 
 func Getdirentries(fd int64, buf *byte, nbytes int64, basep *int64) (ret int64, errno int64) {
        r1, r2, err := Syscall6(SYS_GETDIRENTRIES64, fd, int64(uintptr(unsafe.Pointer(buf))), nbytes, int64(uintptr(unsafe.Pointer(basep))), 0, 0);
+       if r1 != -1 {
+               *basep = r2
+       }
        return r1, err;
 }