From 44e216f2642ff4ea53026792e80df95df71e9905 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sat, 10 Jun 2006 11:29:44 +0000 Subject: [PATCH] - use bb_xchdir instead of ignoring eventual errors of chdir Thanks to Erik Hovland --- archival/dpkg_deb.c | 4 ++-- archival/rpm.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c index b99f227fc..48a1ac161 100644 --- a/archival/dpkg_deb.c +++ b/archival/dpkg_deb.c @@ -89,8 +89,8 @@ int dpkg_deb_main(int argc, char **argv) extract_dir = argv[optind]; } if (extract_dir) { - mkdir(extract_dir, 0777); - chdir(extract_dir); /* error check? */ + mkdir(extract_dir, 0777); /* bb_make_directory(extract_dir, 0777, 0) */ + bb_xchdir(extract_dir); } unpack_ar_archive(ar_archive); diff --git a/archival/rpm.c b/archival/rpm.c index 9bbc4a856..075578971 100644 --- a/archival/rpm.c +++ b/archival/rpm.c @@ -198,7 +198,7 @@ void extract_cpio_gz(int fd) { bb_error_msg_and_die("Invalid gzip magic"); } check_header_gzip(archive_handle->src_fd); - chdir("/"); // Install RPM's to root + bb_xchdir("/"); // Install RPM's to root archive_handle->src_fd = open_transformer(archive_handle->src_fd, inflate_gunzip); archive_handle->offset = 0; -- 2.25.1