From f1291cfdfc6db3922b8aa4672b5511104671788a Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Sat, 14 Apr 2007 16:32:59 +0000 Subject: [PATCH] Exit on return code of read_layout and print error message to stderr instead of stdout (trivial) Signed-off-by: Stefan Reinauer Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2610 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/flashrom/flashrom.c | 3 ++- util/flashrom/layout.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/util/flashrom/flashrom.c b/util/flashrom/flashrom.c index fddefea06d..04c86001d3 100644 --- a/util/flashrom/flashrom.c +++ b/util/flashrom/flashrom.c @@ -303,7 +303,8 @@ int main(int argc, char *argv[]) break; case 'l': tempstr=strdup(optarg); - read_romlayout(tempstr); + if (read_romlayout(tempstr)) + exit(1); break; case 'i': tempstr=strdup(optarg); diff --git a/util/flashrom/layout.c b/util/flashrom/layout.c index 5478782f42..8ba2e4153e 100644 --- a/util/flashrom/layout.c +++ b/util/flashrom/layout.c @@ -106,7 +106,8 @@ int read_romlayout(char *name) romlayout=fopen (name, "r"); if(!romlayout) { - printf("Error while opening rom layout (%s).\n", name); + fprintf(stderr, "ERROR: Could not open rom layout (%s).\n", + name); return -1; }