mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
svc.c - Break out nested function.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -143,16 +143,18 @@ void svc_bootstrap(void)
|
||||
}
|
||||
}
|
||||
|
||||
static int encode(int lvl)
|
||||
{
|
||||
if (!lvl)
|
||||
return 0;
|
||||
|
||||
return lvl + '0';
|
||||
}
|
||||
|
||||
static void utmp_save(int pre, int now)
|
||||
{
|
||||
struct utmp utent;
|
||||
|
||||
int encode(int lvl)
|
||||
{
|
||||
if (!lvl) return 0;
|
||||
return lvl + '0';
|
||||
}
|
||||
|
||||
utent.ut_type = RUN_LVL;
|
||||
utent.ut_pid = (encode(pre) << 8) | (encode(now) & 0xFF);
|
||||
strlcpy(utent.ut_user, "runlevel", sizeof(utent.ut_user));
|
||||
|
||||
Reference in New Issue
Block a user