]>
Commit | Line | Data |
---|---|---|
0f79cdc1 | 1 | /* halt.c - command to halt the computer. */ |
2 | /* | |
3 | * GRUB -- GRand Unified Bootloader | |
f714229e | 4 | * Copyright (C) 2005,2007,2008 Free Software Foundation, Inc. |
0f79cdc1 | 5 | * |
5a79f472 | 6 | * GRUB is free software: you can redistribute it and/or modify |
0f79cdc1 | 7 | * it under the terms of the GNU General Public License as published by |
5a79f472 | 8 | * the Free Software Foundation, either version 3 of the License, or |
0f79cdc1 | 9 | * (at your option) any later version. |
10 | * | |
5a79f472 | 11 | * GRUB is distributed in the hope that it will be useful, |
0f79cdc1 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | * GNU General Public License for more details. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License | |
5a79f472 | 17 | * along with GRUB. If not, see <http://www.gnu.org/licenses/>. |
0f79cdc1 | 18 | */ |
19 | ||
0f79cdc1 | 20 | #include <grub/dl.h> |
b1b797cb | 21 | #include <grub/command.h> |
6b8474f8 | 22 | #include <grub/misc.h> |
77a79592 | 23 | #include <grub/i18n.h> |
0f79cdc1 | 24 | |
e745cf0c VS |
25 | GRUB_MOD_LICENSE ("GPLv3+"); |
26 | ||
02a2bf83 | 27 | static grub_err_t __attribute__ ((noreturn)) |
b1b797cb | 28 | grub_cmd_halt (grub_command_t cmd __attribute__ ((unused)), |
0f79cdc1 | 29 | int argc __attribute__ ((unused)), |
30 | char **args __attribute__ ((unused))) | |
31 | { | |
a5ce3a4a | 32 | grub_halt (); |
0f79cdc1 | 33 | } |
34 | ||
b1b797cb | 35 | static grub_command_t cmd; |
0f79cdc1 | 36 | \f |
f714229e | 37 | GRUB_MOD_INIT(halt) |
0f79cdc1 | 38 | { |
b1b797cb | 39 | cmd = grub_register_command ("halt", grub_cmd_halt, |
77a79592 | 40 | 0, N_("Halts the computer. This command does" |
41 | " not work on all firmware implementations.")); | |
0f79cdc1 | 42 | } |
43 | ||
f714229e | 44 | GRUB_MOD_FINI(halt) |
0f79cdc1 | 45 | { |
b1b797cb | 46 | grub_unregister_command (cmd); |
0f79cdc1 | 47 | } |