diff options
author | Phillip Lougher <phillip@squashfs.org.uk> | 2014-04-20 23:47:08 +0100 |
---|---|---|
committer | Phillip Lougher <phillip@squashfs.org.uk> | 2014-04-20 23:47:08 +0100 |
commit | f0e5e980a2e7902d55ecac52a2fdbb1832c36478 (patch) | |
tree | 8db4eaea3589ad9197bf650ee4383623680a7759 /squashfs-tools/pseudo.c | |
parent | d8d9fe510fa34c8e80a1c6a0d007fc67231ed973 (diff) | |
download | squashfs-tools-f0e5e980a2e7902d55ecac52a2fdbb1832c36478.tar.gz |
pseudo: fix pseudo definition dumping and actually call it
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Diffstat (limited to 'squashfs-tools/pseudo.c')
-rw-r--r-- | squashfs-tools/pseudo.c | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/squashfs-tools/pseudo.c b/squashfs-tools/pseudo.c index c219789..10c0b6a 100644 --- a/squashfs-tools/pseudo.c +++ b/squashfs-tools/pseudo.c @@ -47,32 +47,6 @@ struct pseudo_dev **pseudo_file = NULL; struct pseudo *pseudo = NULL; int pseudo_count = 0; -static void dump_pseudo(struct pseudo *pseudo, char *string) -{ - int i, res; - char *path; - - for(i = 0; i < pseudo->names; i++) { - struct pseudo_entry *entry = &pseudo->name[i]; - if(string) { - res = asprintf(&path, "%s/%s", string, entry->name); - if(res == -1) - BAD_ERROR("asprintf failed in dump_pseudo\n"); - } else - path = entry->name; - if(entry->pseudo == NULL) - ERROR("%s %c %o %d %d %d %d\n", path, entry->dev->type, - entry->dev->mode, entry->dev->uid, - entry->dev->gid, entry->dev->major, - entry->dev->minor); - else - dump_pseudo(entry->pseudo, path); - if(string) - free(path); - } -} - - static char *get_component(char *target, char **targname) { char *start; @@ -571,3 +545,35 @@ struct pseudo *get_pseudo() { return pseudo; } + + +static void dump_pseudo(struct pseudo *pseudo, char *string) +{ + int i, res; + char *path; + + for(i = 0; i < pseudo->names; i++) { + struct pseudo_entry *entry = &pseudo->name[i]; + if(string) { + res = asprintf(&path, "%s/%s", string, entry->name); + if(res == -1) + BAD_ERROR("asprintf failed in dump_pseudo\n"); + } else + path = entry->name; + if(entry->dev) + ERROR("%s %c 0%o %d %d %d %d\n", path, entry->dev->type, + entry->dev->mode & ~S_IFMT, entry->dev->uid, + entry->dev->gid, entry->dev->major, + entry->dev->minor); + if(entry->pseudo) + dump_pseudo(entry->pseudo, path); + if(string) + free(path); + } +} + + +void dump_pseudos() +{ + dump_pseudo(pseudo, NULL); +} |