diff options
author | Scott Wood <scottwood@freescale.com> | 2008-01-03 17:43:31 -0600 |
---|---|---|
committer | Jon Loeliger <jdl@freescale.com> | 2008-01-04 08:20:10 -0600 |
commit | 910efac4b49f43cb1b66eef5aa0bbd020920bf2a (patch) | |
tree | 0e6c49941be4b2003d0bc1dae80849a236abc9ad /dtc.c | |
parent | f77fe6a20e75a2289faf86f9b6b529044a07b072 (diff) | |
download | dtc-910efac4b49f43cb1b66eef5aa0bbd020920bf2a.zip dtc-910efac4b49f43cb1b66eef5aa0bbd020920bf2a.tar.gz dtc-910efac4b49f43cb1b66eef5aa0bbd020920bf2a.tar.bz2 |
Look for include files in the directory of the including file.
Looking in the diretory dtc is invoked from is not very useful behavior.
As part of the code reorganization to implement this, I removed the
uniquifying of name storage -- it seemed a rather dubious optimization
given likely usage, and some aspects of it would have been mildly awkward
to integrate with the new code.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'dtc.c')
-rw-r--r-- | dtc.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -118,7 +118,7 @@ int main(int argc, char *argv[]) int force = 0, check = 0; const char *arg; int opt; - FILE *inf = NULL; + struct dtc_file *inf = NULL; FILE *outf = NULL; int outversion = DEFAULT_FDT_VERSION; int boot_cpuid_phys = 0xfeedbeef; @@ -192,14 +192,18 @@ int main(int argc, char *argv[]) } else if (streq(inform, "fs")) { bi = dt_from_fs(arg); } else if(streq(inform, "dtb")) { - inf = dtc_open_file(arg); - bi = dt_from_blob(inf); + inf = dtc_open_file(arg, NULL); + if (!inf) + die("Couldn't open \"%s\": %s\n", arg, + strerror(errno)); + + bi = dt_from_blob(inf->file); } else { die("Unknown input format \"%s\"\n", inform); } - if (inf && (inf != stdin)) - fclose(inf); + if (inf && inf->file != stdin) + fclose(inf->file); if (! bi || ! bi->dt) die("Couldn't read input tree\n"); |