dtc: Fix error reporting in push_input_file()

Error reporting in push_input_file() is a mess.  One error results in
a message and exit(1), others result in a message and return 0 - which
is turned into an exit(1) at one callsite.  The other callsite doesn't
check errors, but probably should.  One of the error conditions gives
a message, but can only be the result of an internal programming
error, not a user error.

So.  Clean that up by making push_input_file() a void function, using
die() to report errors and quit.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2008-02-26 16:44:29 +11:00 committed by Jon Loeliger
parent 2512a7eb5c
commit 7c635dcb2f
2 changed files with 9 additions and 21 deletions

View file

@ -75,7 +75,7 @@ extern void yyerrorf(char const *, ...) __attribute__((format(printf, 1, 2)));
extern struct dtc_file *srcpos_file;
extern int push_input_file(const char *filename);
extern void push_input_file(const char *filename);
extern int pop_input_file(void);
struct search_path {