From 4e6c8120a53709c4a352db42e997303844c74584 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Wed, 12 Mar 2008 22:10:25 +0000 Subject: crond: make it NOMMU-capable function old new delta safe_setenv4 - 62 +62 ForkJob 472 511 +39 change_identity 21 57 +36 ParseField 564 571 +7 SynchronizeDir 178 176 -2 LogLevel 4 - -4 LogFile 4 - -4 FileBase 4 - -4 DebugOpt 4 - -4 CDir 4 - -4 DeleteFile 141 132 -9 packed_usage 24248 24228 -20 crondlog 157 113 -44 change_identity_e2str 54 - -54 SynchronizeFile 729 671 -58 crond_main 1555 1404 -151 ------------------------------------------------------------------------------ (add/remove: 1/6 grow/shrink: 3/6 up/down: 144/-358) Total: -214 bytes --- libbb/change_identity.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'libbb') diff --git a/libbb/change_identity.c b/libbb/change_identity.c index b2274e0ae..f19aa8aaa 100644 --- a/libbb/change_identity.c +++ b/libbb/change_identity.c @@ -30,22 +30,12 @@ #include "libbb.h" - /* Become the user and group(s) specified by PW. */ -const char *change_identity_e2str(const struct passwd *pw) +void change_identity(const struct passwd *pw) { if (initgroups(pw->pw_name, pw->pw_gid) == -1) - return "cannot set groups"; + bb_perror_msg_and_die("can't set groups"); endgrent(); /* ?? */ xsetgid(pw->pw_gid); xsetuid(pw->pw_uid); - return NULL; -} - -void change_identity(const struct passwd *pw) -{ - const char *err_msg = change_identity_e2str(pw); - - if (err_msg) - bb_simple_perror_msg_and_die(err_msg); } -- cgit v1.2.3