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 | |
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')
-rw-r--r-- | squashfs-tools/mksquashfs.c | 1 | ||||
-rw-r--r-- | squashfs-tools/pseudo.c | 58 | ||||
-rw-r--r-- | squashfs-tools/pseudo.h | 1 |
3 files changed, 34 insertions, 26 deletions
diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c index 3579ea8..7b75e2f 100644 --- a/squashfs-tools/mksquashfs.c +++ b/squashfs-tools/mksquashfs.c @@ -5610,6 +5610,7 @@ printOptions: paths = add_subdir(paths, path); dump_actions(); + dump_pseudos(); if(delete && !keep_as_directory && source == 1 && S_ISDIR(source_buf.st_mode)) 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); +} diff --git a/squashfs-tools/pseudo.h b/squashfs-tools/pseudo.h index d666fe6..35624c7 100644 --- a/squashfs-tools/pseudo.h +++ b/squashfs-tools/pseudo.h @@ -56,3 +56,4 @@ extern struct pseudo_entry *pseudo_readdir(struct pseudo *); extern struct pseudo_dev *get_pseudo_file(int); extern void delete_pseudo_files(); extern struct pseudo *get_pseudo(); +extern void dump_pseudos(); |