diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2008-03-06 12:16:55 +1100 |
---|---|---|
committer | Jon Loeliger <jdl@loeliger.com> | 2008-03-23 08:00:33 -0500 |
commit | f7ea3708c38bd38851baafa83e98d95602e53cbc (patch) | |
tree | c6acbffa899a43be4336d7e695715c2fffcc8d60 /dtc-lexer.l | |
parent | 6c2e4d61f83af4233c3270e4f1ec1da01d90466e (diff) | |
download | dtc-f7ea3708c38bd38851baafa83e98d95602e53cbc.tar.gz |
dtc: Make dtc_open_file() die() if unable to open requested file
All current callers of dtc_open_file() immediately die() if it returns
an error. In a non-interative tool like dtc, it's hard to see what
you could sensibly do to recover from a failure to open an input file
in any case.
Therefore, make dtc_open_file() itself die() if there's an error
opening the requested file. This removes the need for error checking
at the callsites, and ensures a consistent error message in all cases.
While we're at it, change the rror message from fstree.c when we fail
to open the input directory to match dtc_open_file()'s error message.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'dtc-lexer.l')
-rw-r--r-- | dtc-lexer.l | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/dtc-lexer.l b/dtc-lexer.l index 0cd3f69..a643ab3 100644 --- a/dtc-lexer.l +++ b/dtc-lexer.l @@ -259,9 +259,6 @@ void push_input_file(const char *filename) } newfile = dtc_open_file(filename, searchptr); - if (!newfile) - die("Couldn't open \"%s\": %s", filename, strerror(errno)); - incl_file = xmalloc(sizeof(struct incl_file)); |