X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Fls_src%2Fmain.c;h=6ea4da0c87d9594a174f87bbd9a7f6c998ecf0c5;hb=dc30fc07186728379a6afbdc7f68f929ba0ca03b;hp=57ff306174ca8ac9bef4e3d4a7e1214f53b83558;hpb=b7beadbbf953f23b9d88db5ede3720003fac69d4;p=tpg%2Facess2.git diff --git a/Usermode/Applications/ls_src/main.c b/Usermode/Applications/ls_src/main.c index 57ff3061..6ea4da0c 100644 --- a/Usermode/Applications/ls_src/main.c +++ b/Usermode/Applications/ls_src/main.c @@ -75,7 +75,7 @@ int main(int argc, char *argv[]) } // Traverse Directory - while( (tmp = readdir(fd, buf)) ) + while( (tmp = readdir(fd, buf)) > 0 ) { // Error check if(tmp < 0) { @@ -243,19 +243,19 @@ void DisplayFile(char *Filename) // Get Permissions // - Owner - acl.group = 0; acl.id = info.uid; + acl.object = info.uid; _SysGetACL(fd, &acl); if(acl.perms & 1) perms |= 0400; // R if(acl.perms & 2) perms |= 0200; // W if(acl.perms & 8) perms |= 0100; // X // - Group - acl.group = 1; acl.id = info.gid; + acl.object = info.gid | 0x80000000; _SysGetACL(fd, &acl); if(acl.perms & 1) perms |= 0040; // R if(acl.perms & 2) perms |= 0020; // W if(acl.perms & 8) perms |= 0010; // X // - World - acl.group = 1; acl.id = -1; + acl.object = 0xFFFFFFFF; _SysGetACL(fd, &acl); if(acl.perms & 1) perms |= 0004; // R if(acl.perms & 2) perms |= 0002; // W @@ -294,7 +294,7 @@ void DisplayFile(char *Filename) else if(size < (uint64_t)2048*1024*1024*1024) { // < 2 TiB printf("%4i GiB ", size>>30); } - else { // Greater than 2 TiB + else { // Greater than 2 TiB (if your files are larger than this, you are Doing It Wrong [TM]) printf("%4i TiB ", size>>40); } } else {