From 22ed4e7f73d0a9623c4dc6a7788b61331af1fd24 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Fri, 31 Oct 2014 14:58:13 +0100 Subject: [PATCH] svc.c - Break out nested function. Signed-off-by: Joachim Nilsson --- svc.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/svc.c b/svc.c index 9bb041ed..3a3cb38c 100644 --- a/svc.c +++ b/svc.c @@ -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));