aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>2005-01-04 03:04:00 +0000
committerhpa <hpa>2005-01-04 03:04:00 +0000
commit140970b0b6669dfeab8ee42720aab159e5ccd6b5 (patch)
tree2abb25fd89e36676d6a17545f759d638b02ea14b
parent07f71a97359d7fa0f334374ea3b058970088995e (diff)
downloadsyslinux-elf-140970b0b6669dfeab8ee42720aab159e5ccd6b5.tar.gz
syslinux-elf-140970b0b6669dfeab8ee42720aab159e5ccd6b5.tar.xz
syslinux-elf-140970b0b6669dfeab8ee42720aab159e5ccd6b5.zip
Print an error message if the configuration file seems empty.
-rw-r--r--com32/modules/Makefile8
-rw-r--r--com32/modules/menu.c15
2 files changed, 15 insertions, 8 deletions
diff --git a/com32/modules/Makefile b/com32/modules/Makefile
index 8f7ff0aa..23efeb5c 100644
--- a/com32/modules/Makefile
+++ b/com32/modules/Makefile
@@ -20,14 +20,14 @@ gcc_ok = $(shell if gcc $(1) -c -x c /dev/null -o /dev/null 2>/dev/null; \
M32 := $(call gcc_ok,-m32,)
-CC = gcc $(M32)
+CC = gcc
LD = ld -m elf_i386
AR = ar
NASM = nasm
RANLIB = ranlib
-CFLAGS = -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os -fomit-frame-pointer -I../libutil/include -I../include -D__COM32__
-LNXCFLAGS = -W -Wall -march=i386 -Os -g -I../libutil/include
-LNXSFLAGS = -march=i386
+CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os -fomit-frame-pointer -I../libutil/include -I../include -D__COM32__
+LNXCFLAGS = -W -Wall -O -g -I../libutil/include
+LNXSFLAGS = -g
LNXLDFLAGS = -g
SFLAGS = -D__COM32__ -march=i386
LDFLAGS = -T ../lib/com32.ld
diff --git a/com32/modules/menu.c b/com32/modules/menu.c
index 9b918686..039e55cd 100644
--- a/com32/modules/menu.c
+++ b/com32/modules/menu.c
@@ -1,7 +1,7 @@
#ident "$Id$"
/* ----------------------------------------------------------------------- *
*
- * Copyright 2004 H. Peter Anvin - All Rights Reserved
+ * Copyright 2004-2005 H. Peter Anvin - All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -399,7 +399,8 @@ void __attribute__((noreturn)) execute(const char *cmdline)
int main(int argc, char *argv[])
{
- const char *cmdline;
+ const char *cmdline = NULL;
+ int err = 0;
(void)argc;
@@ -408,10 +409,16 @@ int main(int argc, char *argv[])
parse_config(argv[1]);
- cmdline = run_menu();
+ if ( !nentries ) {
+ fputs("No LABEL entries found in configuration file!\n", stdout);
+ err = 1;
+ } else {
+ cmdline = run_menu();
+ }
+
printf("\033[?25h\033[%d;1H\033[0m", END_ROW);
if ( cmdline )
execute(cmdline);
else
- return 0;
+ return err;
}