Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d47d0d commit 08d2071Copy full SHA for 08d2071
1 file changed
Mac/Compat/macstat.c
@@ -54,11 +54,13 @@ macstat(path, buf)
54
buf->st_nlink = 1;
55
buf->st_uid = 1;
56
buf->st_gid = 1;
57
- buf->st_size = pb.f.ioFlLgLen;
+ buf->st_size = (buf->st_mode & S_IFDIR) ? 0 : pb.f.ioFlLgLen;
58
buf->st_mtime = buf->st_atime = pb.f.ioFlMdDat;
59
buf->st_ctime = pb.f.ioFlCrDat;
60
- buf->st_rsize = pb.f.ioFlRLgLen;
61
- *(unsigned long *)buf->st_type = pb.f.ioFlFndrInfo.fdType;
62
- *(unsigned long *)buf->st_creator = pb.f.ioFlFndrInfo.fdCreator;
+ buf->st_rsize = (buf->st_mode & S_IFDIR) ? 0 : pb.f.ioFlRLgLen;
+ *(unsigned long *)buf->st_type =
+ (buf->st_mode & S_IFDIR) ? 0 : pb.f.ioFlFndrInfo.fdType;
63
+ *(unsigned long *)buf->st_creator =
64
+ (buf->st_mode & S_IFDIR) ? 0 : pb.f.ioFlFndrInfo.fdCreator;
65
return 0;
66
}
0 commit comments