mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
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:
parent
2512a7eb5c
commit
7c635dcb2f
2 changed files with 9 additions and 21 deletions
2
srcpos.h
2
srcpos.h
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue