MCPcopy Create free account
hub / github.com/F-Stack/f-stack / shutdown_panic

Function shutdown_panic

freebsd/kern/kern_shutdown.c:619–647  ·  view source on GitHub ↗

* Check to see if the system paniced, pause and then reboot * according to the specified delay. */

Source from the content-addressed store, hash-verified

617 * according to the specified delay.
618 */
619static void
620shutdown_panic(void *junk, int howto)
621{
622 int loop;
623
624 if (howto & RB_DUMP) {
625 if (panic_reboot_wait_time != 0) {
626 if (panic_reboot_wait_time != -1) {
627 printf("Automatic reboot in %d seconds - "
628 "press a key on the console to abort\n",
629 panic_reboot_wait_time);
630 for (loop = panic_reboot_wait_time * 10;
631 loop > 0; --loop) {
632 DELAY(1000 * 100); /* 1/10th second */
633 /* Did user type a key? */
634 if (cncheckc() != -1)
635 break;
636 }
637 if (!loop)
638 return;
639 }
640 } else { /* zero time specified - reboot NOW */
641 return;
642 }
643 printf("--> Press a key on the console to reboot,\n");
644 printf("--> or switch off the system now.\n");
645 cngetc();
646 }
647}
648
649/*
650 * Everything done, now reset

Callers

nothing calls this directly

Calls 4

cncheckcFunction · 0.85
cngetcFunction · 0.85
printfFunction · 0.70
DELAYFunction · 0.50

Tested by

no test coverage detected