[syslinux] [PATCH 2/9] ldlinux: Print a warning if no config file is found

Matt Fleming matt at console-pimps.org
Fri Nov 2 07:13:11 PDT 2012


From: Matt Fleming <matt.fleming at intel.com>

This behaviour is taken from 4.06, where an error message is printed
if no config file is found. A warning is a more user-friendly choice
since Syslinux will still function without a config file.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>
---
 com32/elflink/ldlinux/readconfig.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/com32/elflink/ldlinux/readconfig.c b/com32/elflink/ldlinux/readconfig.c
index 1db397a..2fa0641 100644
--- a/com32/elflink/ldlinux/readconfig.c
+++ b/com32/elflink/ldlinux/readconfig.c
@@ -1420,7 +1420,10 @@ void parse_configs(char **argv)
     current_menu = root_menu;
 
     if (!argv || !*argv) {
-	parse_one_config(NULL);
+	if (parse_one_config(NULL) < 0) {
+	    printf("WARNING: No configuration file found\n");
+	    return;
+	}
     } else {
 	while ((filename = *argv++)) {
 		dprintf("Parsing config: %s", filename);
-- 
1.7.11.7




More information about the Syslinux mailing list