diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-07-27 11:20:10 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-07-27 11:20:10 +0000 |
commit | 3734b946bfef55c8f63d367422da5c7aa7b972db (patch) | |
tree | 1bdd3e14523002dc8276d167b17f900e40fa6dff /libbb/procps.c | |
parent | 661f6fad77b672a5f6648b01275eb9ff19c59139 (diff) | |
download | busybox-w32-3734b946bfef55c8f63d367422da5c7aa7b972db.tar.gz busybox-w32-3734b946bfef55c8f63d367422da5c7aa7b972db.tar.bz2 busybox-w32-3734b946bfef55c8f63d367422da5c7aa7b972db.zip |
bb_getpwuid, bb_getgrgid: change order of arguments to more intuitive one;
comment thoroughly when they die and when they dont.
Diffstat (limited to 'libbb/procps.c')
-rw-r--r-- | libbb/procps.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libbb/procps.c b/libbb/procps.c index 37593700a..aa207af6f 100644 --- a/libbb/procps.c +++ b/libbb/procps.c | |||
@@ -52,7 +52,7 @@ static int get_cached(cache_t *cp, unsigned id) | |||
52 | } | 52 | } |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | typedef char* ug_func(char *name, long uid, int bufsize); | 55 | typedef char* ug_func(char *name, int bufsize, long uid); |
56 | static char* get_cached(cache_t *cp, unsigned id, ug_func* fp) | 56 | static char* get_cached(cache_t *cp, unsigned id, ug_func* fp) |
57 | { | 57 | { |
58 | int i; | 58 | int i; |
@@ -62,7 +62,8 @@ static char* get_cached(cache_t *cp, unsigned id, ug_func* fp) | |||
62 | i = cp->size++; | 62 | i = cp->size++; |
63 | cp->cache = xrealloc(cp->cache, cp->size * sizeof(*cp->cache)); | 63 | cp->cache = xrealloc(cp->cache, cp->size * sizeof(*cp->cache)); |
64 | cp->cache[i].id = id; | 64 | cp->cache[i].id = id; |
65 | fp(cp->cache[i].name, id, sizeof(cp->cache[i].name)); | 65 | /* Never fails. Generates numeric string if name isn't found */ |
66 | fp(cp->cache[i].name, sizeof(cp->cache[i].name), id); | ||
66 | return cp->cache[i].name; | 67 | return cp->cache[i].name; |
67 | } | 68 | } |
68 | const char* get_cached_username(uid_t uid) | 69 | const char* get_cached_username(uid_t uid) |