diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-05 02:44:30 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-05 02:44:30 +0000 |
commit | 1af00eda92e9a036ff217b11ff45ebe559de66f9 (patch) | |
tree | 67472bb3e4eddce347cfe7fa753c24f07faa5c4a /archival/cpio.c | |
parent | 1a95e3960ca7dde16bda26ec9dad986199bae3c3 (diff) | |
download | busybox-w32-1af00eda92e9a036ff217b11ff45ebe559de66f9.tar.gz busybox-w32-1af00eda92e9a036ff217b11ff45ebe559de66f9.tar.bz2 busybox-w32-1af00eda92e9a036ff217b11ff45ebe559de66f9.zip |
cpio: fix a bug where we do not extract zero-sized hardlinks
(spotted at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466771).
Add testsuite entry for that, and another one for another bug:
we do not list hardlinks in cpio -t (not fixed).
function old new delta
get_header_cpio 884 909 +25
static.saved_hardlinks_created - 4 +4
static.pending_hardlinks 4 - -4
static.inode 4 - -4
cpio_main 1122 1060 -62
Diffstat (limited to 'archival/cpio.c')
-rw-r--r-- | archival/cpio.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/archival/cpio.c b/archival/cpio.c index dd9ed756c..2919ff8de 100644 --- a/archival/cpio.c +++ b/archival/cpio.c | |||
@@ -171,9 +171,7 @@ static int cpio_o(void) | |||
171 | int fd = xopen(name, O_RDONLY); | 171 | int fd = xopen(name, O_RDONLY); |
172 | fflush(stdout); | 172 | fflush(stdout); |
173 | /* We must abort if file got shorter too! */ | 173 | /* We must abort if file got shorter too! */ |
174 | if (bb_copyfd_size(fd, STDOUT_FILENO, st.st_size) != st.st_size) { | 174 | bb_copyfd_exact_size(fd, STDOUT_FILENO, st.st_size); |
175 | bb_error_msg_and_die("I/O error or file '%s' was truncated", name); | ||
176 | } | ||
177 | bytes += st.st_size; | 175 | bytes += st.st_size; |
178 | close(fd); | 176 | close(fd); |
179 | } | 177 | } |