diff options
Diffstat (limited to 'init/init.c')
-rw-r--r-- | init/init.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/init/init.c b/init/init.c index 7258d31..088a890 100644 --- a/init/init.c +++ b/init/init.c @@ -29,6 +29,7 @@ #include <errno.h> #include <signal.h> #include <termios.h> +#include <paths.h> #include <sys/types.h> #include <sys/fcntl.h> #include <sys/wait.h> @@ -44,7 +45,6 @@ #include <sys/syslog.h> #endif -#define DEV_CONSOLE "/dev/console" /* Logical system console */ #define VT_PRIMARY "/dev/tty1" /* Primary virtual console */ #define VT_SECONDARY "/dev/tty2" /* Virtual console */ #define VT_LOG "/dev/tty3" /* Virtual console */ @@ -52,11 +52,10 @@ #define SERIAL_CON1 "/dev/ttyS1" /* Serial console */ #define SHELL "/bin/sh" /* Default shell */ #define INITSCRIPT "/etc/init.d/rcS" /* Initscript. */ -#define PATH_DEFAULT "PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin" #define LOG 0x1 #define CONSOLE 0x2 -static char *console = DEV_CONSOLE; +static char *console = _PATH_CONSOLE; static char *second_console = VT_SECONDARY; static char *log = VT_LOG; static int kernel_version = 0; @@ -126,7 +125,7 @@ void message(int device, char *fmt, ...) if (device & CONSOLE) { /* Always send console messages to /dev/console so people will see them. */ - if ((fd = device_open(DEV_CONSOLE, O_WRONLY|O_NOCTTY|O_NDELAY)) >= 0) { + if ((fd = device_open(_PATH_CONSOLE, O_WRONLY|O_NOCTTY|O_NDELAY)) >= 0) { va_start(arguments, fmt); vdprintf(fd, fmt, arguments); va_end(arguments); @@ -242,7 +241,7 @@ static void console_init() /* this is linux virtual tty */ snprintf( the_console, sizeof the_console, "/dev/tty%d", vt.v_active ); } else { - console = DEV_CONSOLE; + console = _PATH_CONSOLE; tried_devcons++; } } @@ -251,7 +250,7 @@ static void console_init() /* Can't open selected console -- try /dev/console */ if (!tried_devcons) { tried_devcons++; - console = DEV_CONSOLE; + console = _PATH_CONSOLE; continue; } /* Can't open selected console -- try vt1 */ @@ -421,6 +420,7 @@ static void halt_signal(int sig) "The system is halted. Press CTRL-ALT-DEL or turn off power\r\n"); sync(); #ifndef DEBUG_INIT + while (1) sleep(1); reboot(RB_HALT_SYSTEM); //reboot(RB_POWER_OFF); #endif @@ -432,6 +432,7 @@ static void reboot_signal(int sig) shutdown_system(); message(CONSOLE, "Please stand by while rebooting the system.\r\n"); sync(); + while (1) sleep(1); #ifndef DEBUG_INIT reboot(RB_AUTOBOOT); #endif @@ -502,7 +503,7 @@ extern int init_main(int argc, char **argv) setsid(); /* Make sure PATH is set to something sane */ - putenv(PATH_DEFAULT); + putenv(_PATH_STDPATH); /* Hello world */ |