From eb469e938da5daaa300e20aa8e7bd4cd29c2bedf Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sun, 11 Apr 2010 18:46:21 -0400 Subject: [PATCH] Don't try to write a body if libarchive won't accept it. SVN-Revision: 2235 --- cpio/cpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpio/cpio.c b/cpio/cpio.c index ac2b4f21d..614b80521 100644 --- a/cpio/cpio.c +++ b/cpio/cpio.c @@ -725,7 +725,7 @@ entry_to_archive(struct cpio *cpio, struct archive_entry *entry) if (r == ARCHIVE_FATAL) exit(1); - if (r >= ARCHIVE_WARN && fd >= 0) { + if (r >= ARCHIVE_WARN && archive_entry_size(entry) > 0 && fd >= 0) { bytes_read = read(fd, cpio->buff, cpio->buff_size); while (bytes_read > 0) { r = archive_write_data(cpio->archive, -- 2.47.3