aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorerik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277>1999-12-17 18:44:15 +0000
committererik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277>1999-12-17 18:44:15 +0000
commit3132131d6265f6107c652f634c8b4a3e006fb46f (patch)
tree1d18bbba8f8a1d78d7ff13e7a87ee2aab165125f /init
parent0055f41a9885374ff57a4b90af63aaac6dd01f58 (diff)
downloadbusybox-w32-3132131d6265f6107c652f634c8b4a3e006fb46f.tar.gz
busybox-w32-3132131d6265f6107c652f634c8b4a3e006fb46f.tar.bz2
busybox-w32-3132131d6265f6107c652f634c8b4a3e006fb46f.zip
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 git-svn-id: svn://busybox.net/trunk/busybox@243 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'init')
-rw-r--r--init/init.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/init/init.c b/init/init.c
index 5203713ca..ba65f51fd 100644
--- a/init/init.c
+++ b/init/init.c
@@ -41,6 +41,7 @@
41#include <linux/serial.h> /* for serial_struct */ 41#include <linux/serial.h> /* for serial_struct */
42#include <sys/vt.h> /* for vt_stat */ 42#include <sys/vt.h> /* for vt_stat */
43#include <sys/ioctl.h> 43#include <sys/ioctl.h>
44#include <linux/version.h>
44#ifdef BB_SYSLOGD 45#ifdef BB_SYSLOGD
45#include <sys/syslog.h> 46#include <sys/syslog.h>
46#endif 47#endif
@@ -49,6 +50,10 @@
49#error Sorry, I depend on the /proc filesystem right now. 50#error Sorry, I depend on the /proc filesystem right now.
50#endif 51#endif
51 52
53#ifndef KERNEL_VERSION
54#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
55#endif
56
52 57
53#define VT_PRIMARY "/dev/tty1" /* Primary virtual console */ 58#define VT_PRIMARY "/dev/tty1" /* Primary virtual console */
54#define VT_SECONDARY "/dev/tty2" /* Virtual console */ 59#define VT_SECONDARY "/dev/tty2" /* Virtual console */
@@ -418,9 +423,11 @@ static void halt_signal(int sig)
418 "The system is halted. Press CTRL-ALT-DEL or turn off power\r\n"); 423 "The system is halted. Press CTRL-ALT-DEL or turn off power\r\n");
419 sync(); 424 sync();
420#ifndef DEBUG_INIT 425#ifndef DEBUG_INIT
426#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
421 if (sig == SIGUSR2) 427 if (sig == SIGUSR2)
422 reboot(RB_POWER_OFF); 428 reboot(RB_POWER_OFF);
423 else 429 else
430#endif
424 reboot(RB_HALT_SYSTEM); 431 reboot(RB_HALT_SYSTEM);
425#endif 432#endif
426 exit(0); 433 exit(0);