aboutsummaryrefslogtreecommitdiff
path: root/init.c
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>1999-12-17 18:44:15 +0000
committerErik Andersen <andersen@codepoet.org>1999-12-17 18:44:15 +0000
commit4d1d0113fd3309aac30b2dd1d443bf7c7d5f0a3d (patch)
tree1d18bbba8f8a1d78d7ff13e7a87ee2aab165125f /init.c
parent6da0ae8183a31d4faab745d534a363c7e66ef864 (diff)
downloadbusybox-4d1d0113fd3309aac30b2dd1d443bf7c7d5f0a3d.tar.gz
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
Diffstat (limited to 'init.c')
-rw-r--r--init.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/init.c b/init.c
index 5203713ca..ba65f51fd 100644
--- a/init.c
+++ b/init.c
@@ -41,6 +41,7 @@
#include <linux/serial.h> /* for serial_struct */
#include <sys/vt.h> /* for vt_stat */
#include <sys/ioctl.h>
+#include <linux/version.h>
#ifdef BB_SYSLOGD
#include <sys/syslog.h>
#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);