Set correct initial bootstrap runlevel 'S'

This patch corrects a long standing issue with Finit.  System initial
bootstrap runlevel must be set to 'S' (0), not the configured fallback
runlevel 'RUNLEVEL', which likely is '2'.

Also, minor cleanup, reduce code duplication.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2016-07-09 10:24:15 +02:00
1 parent 05938a88ce
commit 927956bf78
2 files changed
+6 -14

No files matched your search

+1
View File
@@ -49,6 +49,7 @@ void runlevel_set(int pre, int now)
{
struct utmp utent;
memset(&utent, 0, sizeof(utent));
utent.ut_type = RUN_LVL;
utent.ut_pid = (encode(pre) << 8) | (encode(now) & 0xFF);
strlcpy(utent.ut_user, "runlevel", sizeof(utent.ut_user));