From 0c68a874e7d996c62c8d00b0c0289180bdce1590 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 2 Dec 2008 22:56:59 +0000 Subject: libbb: password/group function helpers rewritten by Tito: function old new delta xgetpwuid - 27 +27 uid2uname_utoa - 22 +22 gid2group_utoa - 22 +22 uid2uname - 18 +18 gid2group - 18 +18 buffer_fill_and_print 179 196 +17 print_user 12 24 +12 print_group 12 24 +12 get_cached 89 99 +10 ... print_common 134 120 -14 vlock_main 415 396 -19 logger_main 410 387 -23 crontab_main 642 609 -33 bb_getpwuid 42 - -42 bb_getgrgid 42 - -42 bb_getug 80 - -80 ------------------------------------------------------------------------------ (add/remove: 6/3 grow/shrink: 9/11 up/down: 187/-296) Total: -109 bytes --- sysklogd/logger.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'sysklogd/logger.c') diff --git a/sysklogd/logger.c b/sysklogd/logger.c index 625811356..759981c75 100644 --- a/sysklogd/logger.c +++ b/sysklogd/logger.c @@ -72,22 +72,21 @@ int logger_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int logger_main(int argc, char **argv) { char *str_p, *str_t; + int opt; int i = 0; - char name[80]; /* Fill out the name string early (may be overwritten later) */ - bb_getpwuid(name, sizeof(name), geteuid()); - str_t = name; + str_t = uid2uname_utoa(geteuid()); /* Parse any options */ - getopt32(argv, "p:st:", &str_p, &str_t); + opt = getopt32(argv, "p:st:", &str_p, &str_t); - if (option_mask32 & 0x2) /* -s */ + if (opt & 0x2) /* -s */ i |= LOG_PERROR; - //if (option_mask32 & 0x4) /* -t */ + //if (opt & 0x4) /* -t */ openlog(str_t, i, 0); i = LOG_USER | LOG_NOTICE; - if (option_mask32 & 0x1) /* -p */ + if (opt & 0x1) /* -p */ i = pencode(str_p); argc -= optind; -- cgit v1.2.3