aboutsummaryrefslogtreecommitdiff
path: root/unpack/rdsquashfs.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-11-16 13:44:17 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-11-18 09:15:47 +0100
commit84210b0ba9f2d2208981fb71967bdcf6001f44b2 (patch)
treedbb7241f216c877348413f78fd6547db728970fd /unpack/rdsquashfs.c
parent71f1500390d8b26e38c151b95d2c48b328df15b1 (diff)
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'unpack/rdsquashfs.c')
-rw-r--r--unpack/rdsquashfs.c11
1 files changed, 5 insertions, 6 deletions
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))