summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMartin Roth <gaumless@gmail.com>2023-08-24 20:18:03 -0600
committerFelix Singer <service+coreboot-gerrit@felixsinger.de>2023-08-27 11:23:28 +0000
commita4e1066ca7a1791973b8f3af60f6c1faace14cb0 (patch)
treeaa4adfc75f4351baee0f5f1bcc14a58c50db1735 /util
parent67448c33f195f266d763f40754824e864f88b8e8 (diff)
util/kconfig: Update toada to halt on errors
The tool 'toada' which converts the Kconfig output to ada syntax keeps running even when it can't parse something. Change that behavior to halt, and update the error message to show where the error is coming from. Signed-off-by: Martin Roth <gaumless@gmail.com> Change-Id: I29807a054581060d04b9ecbe02f2ba666c46bcf2 Reviewed-on: https://review.coreboot.org/c/coreboot/+/77422 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Diffstat (limited to 'util')
-rw-r--r--util/kconfig/toada.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/kconfig/toada.c b/util/kconfig/toada.c
index 02b6351c5d..b5312963c5 100644
--- a/util/kconfig/toada.c
+++ b/util/kconfig/toada.c
@@ -4,6 +4,7 @@
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
+#include <stdlib.h>
static void print_bool(const char *const name, const bool val)
{
@@ -107,8 +108,9 @@ int main(int argc, char *argv[])
print_dec(name, val);
} else {
fprintf(stderr,
- "couldn't parse value '%s' for '%s'\n",
+ "toada: Error: Couldn't parse value '%s' for '%s'\n",
val, name);
+ exit(1);
}
continue;
default: