summaryrefslogtreecommitdiff
path: root/unpack/rdsquashfs.c
diff options
context:
space:
mode:
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))