mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
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>
This commit is contained in:
parent
f77fe6a20e
commit
910efac4b4
5 changed files with 136 additions and 102 deletions
14
dtc.c
14
dtc.c
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue