Several simplifications and indenting changes, per
last_patch97 from vodz
This commit is contained in:
parent
4c6c236781
commit
20c9f1e5e7
@ -47,12 +47,11 @@ extern int kill_init(int sig)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_INIT
|
#ifndef CONFIG_INIT
|
||||||
#define LOG 0x1
|
const char * const bb_shutdown_format = "\r%s\n";
|
||||||
#define CONSOLE 0x2
|
|
||||||
extern int bb_shutdown_system(unsigned long magic)
|
extern int bb_shutdown_system(unsigned long magic)
|
||||||
{
|
{
|
||||||
int pri = LOG_KERN|LOG_NOTICE|LOG_FACMASK;
|
int pri = LOG_KERN|LOG_NOTICE|LOG_FACMASK;
|
||||||
char *message;
|
const char *message;
|
||||||
|
|
||||||
/* Don't kill ourself */
|
/* Don't kill ourself */
|
||||||
signal(SIGTERM,SIG_IGN);
|
signal(SIGTERM,SIG_IGN);
|
||||||
@ -65,26 +64,26 @@ extern int bb_shutdown_system(unsigned long magic)
|
|||||||
#endif
|
#endif
|
||||||
reboot(RB_ENABLE_CAD);
|
reboot(RB_ENABLE_CAD);
|
||||||
|
|
||||||
openlog("shutdown", 0, pri);
|
openlog(bb_applet_name, 0, pri);
|
||||||
|
|
||||||
message = "\n\rThe system is going down NOW !!\n";
|
message = "\nThe system is going down NOW !!";
|
||||||
syslog(pri, "%s", message);
|
syslog(pri, "%s", message);
|
||||||
fprintf(stdout, "%s", message);
|
printf(bb_shutdown_format, message);
|
||||||
|
|
||||||
sync();
|
sync();
|
||||||
|
|
||||||
/* Send signals to every process _except_ pid 1 */
|
/* Send signals to every process _except_ pid 1 */
|
||||||
message = "\rSending SIGTERM to all processes.\n";
|
message = "Sending SIGTERM to all processes.";
|
||||||
syslog(pri, "%s", message);
|
syslog(pri, "%s", message);
|
||||||
fprintf(stdout, "%s", message);
|
printf(bb_shutdown_format, message);
|
||||||
|
|
||||||
kill(-1, SIGTERM);
|
kill(-1, SIGTERM);
|
||||||
sleep(1);
|
sleep(1);
|
||||||
sync();
|
sync();
|
||||||
|
|
||||||
message = "\rSending SIGKILL to all processes.\n";
|
message = "Sending SIGKILL to all processes.";
|
||||||
syslog(pri, "%s", message);
|
syslog(pri, "%s", message);
|
||||||
fprintf(stdout, "%s", message);
|
printf(bb_shutdown_format, message);
|
||||||
|
|
||||||
kill(-1, SIGKILL);
|
kill(-1, SIGKILL);
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user