From 7bb5660647d0106f96b000c25f5690a45734c38c Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 22 Jul 2014 17:20:15 -0700 Subject: 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 --- toolbox/ls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'toolbox/ls.c') 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)); -- cgit v1.1