svc.c - Break out nested function.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2014-10-31 14:58:13 +01:00
parent 327ac9f931
commit 22ed4e7f73
+8 -6
View File
@@ -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));