From 4d1d0113fd3309aac30b2dd1d443bf7c7d5f0a3d Mon Sep 17 00:00:00 2001 From: Erik Andersen Date: Fri, 17 Dec 1999 18:44:15 +0000 Subject: Reworked the source so it will compile and run under glibc 2.0.7 and linux kernel 2.0.36 (though the dubious reasons why someone would want to do that defy imagination ;) -Erik --- init/init.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'init') diff --git a/init/init.c b/init/init.c index 5203713..ba65f51 100644 --- a/init/init.c +++ b/init/init.c @@ -41,6 +41,7 @@ #include /* for serial_struct */ #include /* for vt_stat */ #include +#include #ifdef BB_SYSLOGD #include #endif @@ -49,6 +50,10 @@ #error Sorry, I depend on the /proc filesystem right now. #endif +#ifndef KERNEL_VERSION +#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) +#endif + #define VT_PRIMARY "/dev/tty1" /* Primary virtual console */ #define VT_SECONDARY "/dev/tty2" /* Virtual console */ @@ -418,9 +423,11 @@ static void halt_signal(int sig) "The system is halted. Press CTRL-ALT-DEL or turn off power\r\n"); sync(); #ifndef DEBUG_INIT +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) if (sig == SIGUSR2) reboot(RB_POWER_OFF); else +#endif reboot(RB_HALT_SYSTEM); #endif exit(0); -- cgit v1.1