]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/hfs/hfs_vnops.c
xnu-517.9.4.tar.gz
[apple/xnu.git] / bsd / hfs / hfs_vnops.c
index be91f25e68e3045af505d3bafb1388762ce6e779..2b1552c4348006e147a06366c0ec61da7e1b2caa 100644 (file)
@@ -2879,6 +2879,14 @@ hfs_readdir(ap)
 
                *ap->a_ncookies = ncookies;
                *ap->a_cookies = cookies;
+               
+               /* handle cookies for "." and ".." */
+               if (off == 0) {
+                       cookies[0] = 0;
+                       cookies[1] = sizeof(struct hfsdotentry);
+               } else if (off == sizeof(struct hfsdotentry)) {
+                       cookies[0] = sizeof(struct hfsdotentry);
+               }
        }
 
        /* If there are no children then we're done */