aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/dpkg_deb.c18
-rw-r--r--archival/tar.c7
-rw-r--r--archival/unzip.c5
3 files changed, 9 insertions, 21 deletions
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c
index fa89e44a0..fc8b9221d 100644
--- a/archival/dpkg_deb.c
+++ b/archival/dpkg_deb.c
@@ -1,18 +1,8 @@
1/* vi: set sw=4 ts=4: */
1/* 2/*
2 * This program is free software; you can redistribute it and/or modify 3 * dpkg-deb packs, unpacks and provides information about Debian archives.
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU Library General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 * 4 *
5 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
16 */ 6 */
17#include <fcntl.h> 7#include <fcntl.h>
18#include <stdlib.h> 8#include <stdlib.h>
@@ -100,7 +90,7 @@ int dpkg_deb_main(int argc, char **argv)
100 } 90 }
101 if (extract_dir) { 91 if (extract_dir) {
102 mkdir(extract_dir, 0777); 92 mkdir(extract_dir, 0777);
103 chdir(extract_dir); 93 chdir(extract_dir); /* error check? */
104 } 94 }
105 unpack_ar_archive(ar_archive); 95 unpack_ar_archive(ar_archive);
106 96
diff --git a/archival/tar.c b/archival/tar.c
index 9d0a7c5e4..dcc2f163e 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -19,9 +19,8 @@
19 * 19 *
20 * Based in part on the tar implementation from busybox-0.28 20 * Based in part on the tar implementation from busybox-0.28
21 * Copyright (C) 1995 Bruce Perens 21 * Copyright (C) 1995 Bruce Perens
22 * This is free software under the GNU General Public License.
23 * 22 *
24 * Licensed under GPL v2 (or later), see file LICENSE in this tarball. 23 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
25 */ 24 */
26 25
27#include <fcntl.h> 26#include <fcntl.h>
@@ -834,8 +833,8 @@ int tar_main(int argc, char **argv)
834 } 833 }
835 } 834 }
836 835
837 if ((base_dir) && (chdir(base_dir))) 836 if (base_dir)
838 bb_perror_msg_and_die("Couldnt chdir to %s", base_dir); 837 bb_xchdir(base_dir);
839 838
840 /* create an archive */ 839 /* create an archive */
841 if (ENABLE_FEATURE_TAR_CREATE && (opt & CTX_CREATE)) { 840 if (ENABLE_FEATURE_TAR_CREATE && (opt & CTX_CREATE)) {
diff --git a/archival/unzip.c b/archival/unzip.c
index bb7197d3e..b9dff1985 100644
--- a/archival/unzip.c
+++ b/archival/unzip.c
@@ -236,9 +236,8 @@ int unzip_main(int argc, char **argv)
236 } 236 }
237 237
238 /* Change dir if necessary */ 238 /* Change dir if necessary */
239 if (base_dir && chdir(base_dir)) { 239 if (base_dir)
240 bb_perror_msg_and_die("Cannot chdir"); 240 bb_xchdir(base_dir);
241 }
242 241
243 if (verbosity != v_silent) 242 if (verbosity != v_silent)
244 printf("Archive: %s\n", src_fn); 243 printf("Archive: %s\n", src_fn);