summaryrefslogtreecommitdiff
path: root/archival/tar.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-04-12 18:39:58 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-04-12 18:39:58 +0000
commitd9cf7ac781c1274d6d23fa5674b6b90baaf4cf61 (patch)
treec7e395cfe1eafcd601bc16e0231fc30f8789e4d9 /archival/tar.c
parent67f641e75b685abe1588b634b409c1ee2ff68c22 (diff)
downloadbusybox-w32-d9cf7ac781c1274d6d23fa5674b6b90baaf4cf61.tar.gz
busybox-w32-d9cf7ac781c1274d6d23fa5674b6b90baaf4cf61.tar.bz2
busybox-w32-d9cf7ac781c1274d6d23fa5674b6b90baaf4cf61.zip
- patch from Denis Vlasenko to add and use bb_xchdir()
Diffstat (limited to 'archival/tar.c')
-rw-r--r--archival/tar.c7
1 files changed, 3 insertions, 4 deletions
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)) {