static void delete_initAction(initAction * action);
-
+static void loop_forever()
+{
+ while (1)
+ sleep (1);
+}
/* Print a message to the specified device.
* Device may be bitwise-or'd from LOG | CONSOLE */
goodnight:
message(CONSOLE,
"Sorry, your computer does not have enough memory.\r\n");
- while (1)
- sleep(1);
+ loop_forever();
}
/* Run all commands to be run right before halt/reboot */
init_reboot(RB_POWER_OFF);
else
init_reboot(RB_HALT_SYSTEM);
- exit(0);
+
+ loop_forever();
}
static void reboot_signal(int sig)
sleep(2);
init_reboot(RB_AUTOBOOT);
- exit(0);
+
+ loop_forever();
}
static void ctrlaltdel_signal(int sig)
newAction = calloc((size_t) (1), sizeof(initAction));
if (!newAction) {
message(LOG | CONSOLE, "Memory allocation failure\n");
- while (1)
- sleep(1);
+ loop_forever();
}
newAction->nextPtr = initActionList;
initActionList = newAction;
if (initActionList == NULL) {
message(LOG | CONSOLE,
"No more tasks for init -- sleeping forever.\n");
- while (1)
- sleep(1);
+ loop_forever();
}
/* Now run the looping stuff for the rest of forever */
static void delete_initAction(initAction * action);
-
+static void loop_forever()
+{
+ while (1)
+ sleep (1);
+}
/* Print a message to the specified device.
* Device may be bitwise-or'd from LOG | CONSOLE */
goodnight:
message(CONSOLE,
"Sorry, your computer does not have enough memory.\r\n");
- while (1)
- sleep(1);
+ loop_forever();
}
/* Run all commands to be run right before halt/reboot */
init_reboot(RB_POWER_OFF);
else
init_reboot(RB_HALT_SYSTEM);
- exit(0);
+
+ loop_forever();
}
static void reboot_signal(int sig)
sleep(2);
init_reboot(RB_AUTOBOOT);
- exit(0);
+
+ loop_forever();
}
static void ctrlaltdel_signal(int sig)
newAction = calloc((size_t) (1), sizeof(initAction));
if (!newAction) {
message(LOG | CONSOLE, "Memory allocation failure\n");
- while (1)
- sleep(1);
+ loop_forever();
}
newAction->nextPtr = initActionList;
initActionList = newAction;
if (initActionList == NULL) {
message(LOG | CONSOLE,
"No more tasks for init -- sleeping forever.\n");
- while (1)
- sleep(1);
+ loop_forever();
}
/* Now run the looping stuff for the rest of forever */