git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Usermode - Little debug and other fixes
[tpg/acess2.git]
/
Usermode
/
Applications
/
ls_src
/
main.c
diff --git
a/Usermode/Applications/ls_src/main.c
b/Usermode/Applications/ls_src/main.c
index
297f5f9
..
4be8f0a
100644
(file)
--- a/
Usermode/Applications/ls_src/main.c
+++ b/
Usermode/Applications/ls_src/main.c
@@
-152,7
+152,7
@@
void ParseArguments(int argc, char *argv[])
// Human readable sizes
case 'h': gbViewHumanReadable = 1; continue;
default:
// Human readable sizes
case 'h': gbViewHumanReadable = 1; continue;
default:
- fprintf(stderr, "%s: Unknown option '%c'\n", *str);
+ fprintf(stderr, "%s: Unknown option '%c'\n",
argv[0],
*str);
ShowUsage(argv[0]);
exit(EXIT_FAILURE);
}
ShowUsage(argv[0]);
exit(EXIT_FAILURE);
}
@@
-243,19
+243,19
@@
void DisplayFile(char *Filename)
// Get Permissions
// - Owner
// 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
_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
_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
_SysGetACL(fd, &acl);
if(acl.perms & 1) perms |= 0004; // R
if(acl.perms & 2) perms |= 0002; // W
@@
-283,22
+283,22
@@
void DisplayFile(char *Filename)
printf("%s %4i %4i ", permStr, owner, group);
if(gbViewHumanReadable && type != FTYPE_DIR) {
if(size < 2048) { // < 2 KiB
printf("%s %4i %4i ", permStr, owner, group);
if(gbViewHumanReadable && type != FTYPE_DIR) {
if(size < 2048) { // < 2 KiB
- printf("%4i B ", size);
+ printf("%4
ll
i B ", size);
}
else if(size < 2048*1024) { // < 2 MiB
}
else if(size < 2048*1024) { // < 2 MiB
- printf("%4i KiB ", size>>10);
+ printf("%4
ll
i KiB ", size>>10);
}
else if(size < (uint64_t)2048*1024*1024) { // < 2 GiB
}
else if(size < (uint64_t)2048*1024*1024) { // < 2 GiB
- printf("%4i MiB ", size>>20);
+ printf("%4
ll
i MiB ", size>>20);
}
else if(size < (uint64_t)2048*1024*1024*1024) { // < 2 TiB
}
else if(size < (uint64_t)2048*1024*1024*1024) { // < 2 TiB
- printf("%4i GiB ", size>>30);
+ printf("%4
ll
i GiB ", size>>30);
}
}
- else { // Greater than 2 TiB
- printf("%4i TiB ", size>>40);
+ else { // Greater than 2 TiB
(if your files are larger than this, you are Doing It Wrong [TM])
+ printf("%4
ll
i TiB ", size>>40);
}
} else {
}
} else {
- printf("%8i ", size);
+ printf("%8
ll
i ", size);
}
}
}
}
UCC
git Repository :: git.ucc.asn.au