* Check to see if the system paniced, pause and then reboot * according to the specified delay. */
| 617 | * according to the specified delay. |
| 618 | */ |
| 619 | static void |
| 620 | shutdown_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 |