aboutsummaryrefslogtreecommitdiffstats
path: root/com32/elflink/ldlinux/readconfig.c
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-05-03 13:19:52 +0100
committerMatt Fleming <matt.fleming@intel.com>2012-05-03 13:50:14 +0100
commitb6f8015f2335da9ce400b84787ca5721bf1bf867 (patch)
tree7baf23a1ceb6ac691f234b10125d0f114af6aa15 /com32/elflink/ldlinux/readconfig.c
parent254db41a8b0cf5f92bd6ff3f3e20bbd64ede071e (diff)
downloadsyslinux-b6f8015f2335da9ce400b84787ca5721bf1bf867.tar.gz
syslinux-b6f8015f2335da9ce400b84787ca5721bf1bf867.tar.xz
syslinux-b6f8015f2335da9ce400b84787ca5721bf1bf867.zip
elflink: Fix TIMEOUT and TOTALTIMEOUT handling
Paulo reported that his default command line wasn't being executed when the timeout specified in his config file elapsed. This is because mygetkey() wasn't correctly applying the timeout when waiting for input. Furthermore, it seems the ONTIMEOUT parsing was also broken. Reported-by: Paulo Alcantara <pcacjr@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'com32/elflink/ldlinux/readconfig.c')
-rw-r--r--com32/elflink/ldlinux/readconfig.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/com32/elflink/ldlinux/readconfig.c b/com32/elflink/ldlinux/readconfig.c
index 70fe3461..885c81aa 100644
--- a/com32/elflink/ldlinux/readconfig.c
+++ b/com32/elflink/ldlinux/readconfig.c
@@ -68,6 +68,7 @@ short nohalt = 1; //idle.inc
const char *default_cmd = NULL; //"default" command line
const char *onerror = NULL; //"onerror" command line
+const char *ontimeout = NULL; //"ontimeout" command line
/* Empty refstring */
const char *empty_string;
@@ -79,6 +80,7 @@ struct menu *root_menu, *start_menu, *hide_menu, *menu_list, *default_menu;
int shiftkey = 0; /* Only display menu if shift key pressed */
int hiddenmenu = 0;
long long totaltimeout = 0;
+unsigned int kbdtimeout = 0;
/* Keep track of global default */
static int has_ui = 0; /* DEFAULT only counts if UI is found */
@@ -1081,11 +1083,12 @@ do_include:
//dprintf("got a kernel: %s, type = %d", ld.kernel, ld.type);
}
} else if (looking_at(p, "timeout")) {
- m->timeout = (atoi(skipspace(p + 7)) * CLK_TCK + 9) / 10;
+ kbdtimeout = (atoi(skipspace(p + 7)) * CLK_TCK + 9) / 10;
} else if (looking_at(p, "totaltimeout")) {
totaltimeout = (atoll(skipspace(p + 13)) * CLK_TCK + 9) / 10;
} else if (looking_at(p, "ontimeout")) {
- m->ontimeout = refstrdup(skipspace(p + 9));
+ ontimeout = refstrdup(skipspace(p + 9));
+ ontimeoutlen = strlen(ontimeout);
} else if (looking_at(p, "allowoptions")) {
m->allowedit = !!atoi(skipspace(p + 12));
} else if (looking_at(p, "ipappend")) {