aboutsummaryrefslogtreecommitdiffstats
path: root/com32/rosh/rosh.c
diff options
context:
space:
mode:
authorGene Cumm <gene.cumm@gmail.com>2010-10-03 07:12:06 -0400
committerGene Cumm <gene.cumm@gmail.com>2010-10-09 07:33:08 -0400
commitafb0c23c5f1dc25e4f0a71141b0ed42a1d81c96f (patch)
tree368779283efb5ca80fcdb5d9b7ce0e8f7fef998d /com32/rosh/rosh.c
parente5113373998003f6858abe5074a8c2c57f8a5dad (diff)
downloadsyslinux-afb0c23c5f1dc25e4f0a71141b0ed42a1d81c96f.tar.gz
syslinux-afb0c23c5f1dc25e4f0a71141b0ed42a1d81c96f.tar.xz
syslinux-afb0c23c5f1dc25e4f0a71141b0ed42a1d81c96f.zip
rosh: Add argc/argv rosh_reboot(); Allow warm reboots
Diffstat (limited to 'com32/rosh/rosh.c')
-rw-r--r--com32/rosh/rosh.c34
1 files changed, 27 insertions, 7 deletions
diff --git a/com32/rosh/rosh.c b/com32/rosh/rosh.c
index e8c29faf..70010d4b 100644
--- a/com32/rosh/rosh.c
+++ b/com32/rosh/rosh.c
@@ -41,7 +41,7 @@
#define APP_NAME "rosh"
#define APP_AUTHOR "Gene Cumm"
#define APP_YEAR "2010"
-#define APP_VER "beta-b080"
+#define APP_VER "beta-b082"
/* Print version information to stdout
*/
@@ -1095,13 +1095,33 @@ void rosh_pwd(const char *cmdstr)
ROSH_DEBUG2(" --%08X\n", istr);
} /* rosh_pwd */
-/* Reboot
+/* Reboot; use warm reboot if one of certain options set
+ * argc Argument count
+ * argv Argument values
*/
-void rosh_reboot(void)
+void rosh_reboot(int argc, char *argv[])
{
-// char cmdstr[ROSH_CMD_SZ];
-// printf
- syslinux_reboot(0);
+ int rtype = 0;
+ if (argc) {
+ /* For now, just use the first */
+ switch (argv[0][0]) {
+ case '1':
+ case 's':
+ case 'w':
+ rtype = 1;
+ break;
+ case '-':
+ switch (argv[0][1]) {
+ case '1':
+ case 's':
+ case 'w':
+ rtype = 1;
+ break;
+ }
+ break;
+ }
+ }
+ syslinux_reboot(rtype);
} /* rosh_reboot */
/* Run a boot string, calling syslinux_run_command
@@ -1268,7 +1288,7 @@ char rosh_command(int argc, char *argv[], const char *ipwdstr)
case 'e':
case 'E':
if (strncasecmp("reboot", argv[0], tlen) == 0)
- rosh_reboot();
+ rosh_reboot(argc - 1, &argv[1]);
else
rosh_help(1, NULL);
break;