From 896f913571ab85ba6dd3267f2651f87111261fd4 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 1 Nov 2013 19:46:30 +0100 Subject: [PATCH] * grub-core/term/serial.c (options), (grub_cmd_serial): Fix handling of SI suffixes. --- ChangeLog | 5 +++++ grub-core/term/serial.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0470480ae..c59def2b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-11-01 Vladimir Serbinenko + + * grub-core/term/serial.c (options), (grub_cmd_serial): Fix handling + of SI suffixes. + 2013-11-01 Vladimir Serbinenko Support --base-clock for serial command to handle weird cards with diff --git a/grub-core/term/serial.c b/grub-core/term/serial.c index 0298ec613..2b97fcc6d 100644 --- a/grub-core/term/serial.c +++ b/grub-core/term/serial.c @@ -59,7 +59,7 @@ static const struct grub_arg_option options[] = {"word", 'w', 0, N_("Set the serial port word length."), 0, ARG_TYPE_INT}, {"parity", 'r', 0, N_("Set the serial port parity."), 0, ARG_TYPE_STRING}, {"stop", 't', 0, N_("Set the serial port stop bits."), 0, ARG_TYPE_INT}, - {"base-clock", 'b', 0, N_("Set the base clock."), 0, ARG_TYPE_INT}, + {"base-clock", 'b', 0, N_("Set the base clock."), 0, ARG_TYPE_STRING}, {0, 0, 0, 0, 0, 0} }; @@ -254,6 +254,8 @@ grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args) { char *ptr; config.base_clock = grub_strtoull (state[OPTION_BASE_CLOCK].arg, &ptr, 0); + if (grub_errno) + return grub_errno; if (ptr && *ptr == 'M') config.base_clock *= 1000000; if (ptr && (*ptr == 'k' || *ptr == 'K'))