summaryrefslogtreecommitdiff
path: root/archival/cpio.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-06-27 15:52:07 +0000
committerDenis Vlasenko2008-06-27 15:52:07 +0000
commitbbd55c9ec71f6a65ea876951b8c51df7df8b8da6 (patch)
tree1cd82948592aadc875d0faf70e9b14394b323e8c /archival/cpio.c
parent2bbdda09dfaf5f2c788ce38aba80a1e562c954c8 (diff)
downloadbusybox-bbd55c9ec71f6a65ea876951b8c51df7df8b8da6.zip
busybox-bbd55c9ec71f6a65ea876951b8c51df7df8b8da6.tar.gz
cpio: fix -m to actually work as expected (Pascal Bellard)
function old new delta cpio_main 1140 1153 +13
Diffstat (limited to 'archival/cpio.c')
-rw-r--r--archival/cpio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/archival/cpio.c b/archival/cpio.c
index 2919ff8..0147d0e 100644
--- a/archival/cpio.c
+++ b/archival/cpio.c
@@ -204,7 +204,7 @@ int cpio_main(int argc ATTRIBUTE_UNUSED, char **argv)
archive_handle = init_handle();
archive_handle->src_fd = STDIN_FILENO;
archive_handle->seek = seek_by_read;
- archive_handle->flags = ARCHIVE_EXTRACT_NEWER | ARCHIVE_PRESERVE_DATE;
+ archive_handle->flags = ARCHIVE_EXTRACT_NEWER;
#if ENABLE_FEATURE_CPIO_O
opt = getopt32(argv, "ituvF:dmoH:", &cpio_filename, &cpio_fmt);
@@ -258,6 +258,9 @@ int cpio_main(int argc ATTRIBUTE_UNUSED, char **argv)
if (opt & CPIO_OPT_CREATE_LEADING_DIR) {
archive_handle->flags |= ARCHIVE_CREATE_LEADING_DIRS;
}
+ if (opt & CPIO_OPT_PRESERVE_MTIME) {
+ archive_handle->flags |= ARCHIVE_PRESERVE_DATE;
+ }
while (*argv) {
archive_handle->filter = filter_accept_list;