From e68a6ca225115a8796e6d63ffc32856043e25886 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 22 Mar 2013 13:54:44 +0000 Subject: [cmdline] Add ability to perform a warm reboot Signed-off-by: Michael Brown --- src/hci/commands/reboot_cmd.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/hci/commands') diff --git a/src/hci/commands/reboot_cmd.c b/src/hci/commands/reboot_cmd.c index 19d3d6df4..44dcfc71c 100644 --- a/src/hci/commands/reboot_cmd.c +++ b/src/hci/commands/reboot_cmd.c @@ -17,6 +17,7 @@ * 02110-1301, USA. */ +#include #include #include #include @@ -30,14 +31,20 @@ FILE_LICENCE ( GPL2_OR_LATER ); */ /** "reboot" options */ -struct reboot_options {}; +struct reboot_options { + /** Perform a warm reboot */ + int warm; +}; /** "reboot" option list */ -static struct option_descriptor reboot_opts[] = {}; +static struct option_descriptor reboot_opts[] = { + OPTION_DESC ( "warm", 'w', no_argument, + struct reboot_options, warm, parse_flag ), +}; /** "reboot" command descriptor */ static struct command_descriptor reboot_cmd = - COMMAND_DESC ( struct reboot_options, reboot_opts, 0, 0, "" ); + COMMAND_DESC ( struct reboot_options, reboot_opts, 0, 0, "[--warm]" ); /** * The "reboot" command @@ -55,7 +62,7 @@ static int reboot_exec ( int argc, char **argv ) { return rc; /* Reboot system */ - reboot(); + reboot ( opts.warm ); return 0; } -- cgit v1.2.3-55-g7522