From 84210b0ba9f2d2208981fb71967bdcf6001f44b2 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 16 Nov 2019 13:44:17 +0100 Subject: Remove pushd/popd usage from rdsquashfs unpacking code Instead, reconstruct the full path and use that instead. We do that anyway if --quiet is not set. Signed-off-by: David Oberhollenzer --- unpack/rdsquashfs.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'unpack/rdsquashfs.c') diff --git a/unpack/rdsquashfs.c b/unpack/rdsquashfs.c index 2f84264..4acc71e 100644 --- a/unpack/rdsquashfs.c +++ b/unpack/rdsquashfs.c @@ -135,10 +135,12 @@ int main(int argc, char **argv) case OP_UNPACK: if (opt.unpack_root != NULL) { if (mkdir_p(opt.unpack_root)) - return -1; + goto out; - if (pushd(opt.unpack_root)) - return -1; + if (chdir(opt.unpack_root)) { + perror(opt.unpack_root); + goto out; + } } if (restore_fstree(n, opt.flags)) @@ -149,9 +151,6 @@ int main(int argc, char **argv) if (update_tree_attribs(xattr, n, opt.flags)) goto out; - - if (opt.unpack_root != NULL && popd() != 0) - goto out; break; case OP_DESCRIBE: if (describe_tree(n, opt.unpack_root)) -- cgit v1.2.3