summaryrefslogtreecommitdiffstats
path: root/toolbox/ls.c
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-07-22 17:20:15 -0700
committerElliott Hughes <enh@google.com>2014-07-25 10:51:19 -0700
commit7bb5660647d0106f96b000c25f5690a45734c38c (patch)
treeba1d62bc77ee88071f170df38c97ac1e5dbf4a12 /toolbox/ls.c
parenteb49dd791ec80d42cbe066b78b6f0d8c17791ecd (diff)
downloadsystem_core-7bb5660647d0106f96b000c25f5690a45734c38c.zip
system_core-7bb5660647d0106f96b000c25f5690a45734c38c.tar.gz
system_core-7bb5660647d0106f96b000c25f5690a45734c38c.tar.bz2
Refresh toolbox.
Use more upstream NetBSD, and update those things that were already NetBSD. Note that unlike bionic, the upstream-netbsd directory isn't pristine; we have changes marked by __ANDROID__. Bug: 16493461 (cherry picked from commit fd4c6b0a3a25921a9fe24691a695d715aecb6afe) Change-Id: I53267edaac0b92ad062a5df0f3201e3952eb084e
Diffstat (limited to 'toolbox/ls.c')
-rw-r--r--toolbox/ls.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toolbox/ls.c b/toolbox/ls.c
index 011f7b5..963fcb5 100644
--- a/toolbox/ls.c
+++ b/toolbox/ls.c
@@ -33,7 +33,7 @@
// fwd
static int listpath(const char *name, int flags);
-static char mode2kind(unsigned mode)
+static char mode2kind(mode_t mode)
{
switch(mode & S_IFMT){
case S_IFSOCK: return 's';
@@ -47,7 +47,7 @@ static char mode2kind(unsigned mode)
}
}
-static void mode2str(unsigned mode, char *out)
+void strmode(mode_t mode, char *out)
{
*out++ = mode2kind(mode);
@@ -180,7 +180,7 @@ static int listfile_long(const char *path, struct stat *s, int flags)
name++;
}
- mode2str(s->st_mode, mode);
+ strmode(s->st_mode, mode);
if (flags & LIST_LONG_NUMERIC) {
snprintf(user, sizeof(user), "%u", s->st_uid);
snprintf(group, sizeof(group), "%u", s->st_gid);
@@ -260,7 +260,7 @@ static int listfile_maclabel(const char *path, struct stat *s)
return -1;
}
- mode2str(s->st_mode, mode);
+ strmode(s->st_mode, mode);
user2str(s->st_uid, user, sizeof(user));
group2str(s->st_gid, group, sizeof(group));