lkml.org 
[lkml]   [1998]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Power Off on Halt: Solution
On Tue, Mar 17, 1998 at 08:43:14PM +0100, Bernhard Rosenkraenzer wrote:
>
> Can't be glibc...
> I'm having the same problem on a ATX K6 running sysvinit 2.73 and glibc
> 2.0.7 as well as a Medion Notebook running sysvinit 2.73 and libc 5.4.44.

The solution is much easier:
The power_off command did get an own magic number for the syscall:
Have a look into linux/include/linux/reboot.h

Apply the attached patch. (It's against sysvinit-2.69.)
I left the BMAGIC_HALT for 2.0 compatibility.

--
Kurt Garloff, Dortmund
<K.Garloff@ping.de>
PGP key on http://student.physik.uni-dortmund.de/homepages/garloff
--- sysvinit-2.69/halt.c Tue Aug 13 11:55:58 1996
+++ sysvinit-2.69/halt.c.new Wed Mar 18 00:03:05 1998
@@ -234,6 +239,7 @@
kill(1, SIGTSTP);

/* And perform the `halt' system call. */
+ init_reboot(BMAGIC_PWOFF);
init_reboot(BMAGIC_HALT);
}
/* If we return, we (c)ontinued from the kernel monitor. */
--- sysvinit-2.69/reboot.h Tue Jul 23 20:26:45 1996
+++ sysvinit-2.69/reboot.h.new Wed Mar 18 00:02:44 1998
@@ -14,6 +14,7 @@
#define BMAGIC_SOFT 0
#define BMAGIC_REBOOT 0x01234567
#define BMAGIC_HALT 0xCDEF0123
+#define BMAGIC_PWOFF 0x4321FEDC

#if __GNU_LIBRARY__ >= 6
#define init_reboot(magic) reboot(magic)
\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.793 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site