mirror of
https://github.com/sheumann/hush.git
synced 2025-02-03 23:34:27 +00:00
devfsd: remove static variable
function old new delta static.msg 4 - -4 get_uid_gid 114 107 -7 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-11) Total: -11 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
924a179cb7
commit
4d8ad381ab
@ -1083,10 +1083,7 @@ static int get_uid_gid(int flag, const char *string)
|
|||||||
{
|
{
|
||||||
struct passwd *pw_ent;
|
struct passwd *pw_ent;
|
||||||
struct group *grp_ent;
|
struct group *grp_ent;
|
||||||
static const char *msg;
|
const char *msg;
|
||||||
|
|
||||||
if (ENABLE_DEVFSD_VERBOSE)
|
|
||||||
msg = "user";
|
|
||||||
|
|
||||||
if (isdigit(string[0]) || ((string[0] == '-') && isdigit(string[1])))
|
if (isdigit(string[0]) || ((string[0] == '-') && isdigit(string[1])))
|
||||||
return atoi(string);
|
return atoi(string);
|
||||||
@ -1094,10 +1091,15 @@ static int get_uid_gid(int flag, const char *string)
|
|||||||
if (flag == UID && (pw_ent = getpwnam(string)) != NULL)
|
if (flag == UID && (pw_ent = getpwnam(string)) != NULL)
|
||||||
return pw_ent->pw_uid;
|
return pw_ent->pw_uid;
|
||||||
|
|
||||||
if (flag == GID && (grp_ent = getgrnam(string)) != NULL)
|
if (ENABLE_DEVFSD_VERBOSE)
|
||||||
|
msg = "user";
|
||||||
|
|
||||||
|
if (flag == GID) {
|
||||||
|
if ((grp_ent = getgrnam(string)) != NULL)
|
||||||
return grp_ent->gr_gid;
|
return grp_ent->gr_gid;
|
||||||
else if (ENABLE_DEVFSD_VERBOSE)
|
if (ENABLE_DEVFSD_VERBOSE)
|
||||||
msg = "group";
|
msg = "group";
|
||||||
|
}
|
||||||
|
|
||||||
if (ENABLE_DEVFSD_VERBOSE)
|
if (ENABLE_DEVFSD_VERBOSE)
|
||||||
msg_logger(LOG_ERR, "unknown %s: %s, defaulting to %cid=0", msg, string, msg[0]);
|
msg_logger(LOG_ERR, "unknown %s: %s, defaulting to %cid=0", msg, string, msg[0]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user