From 7b073160a3d33eb9506fdc7911525c9ab9c482dd Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 20 Feb 2011 22:44:10 +1100 Subject: [PATCH] Can't always open fd_out in runzip for integrity testing, so use fd_hist. --- runzip.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runzip.c b/runzip.c index 8fa5d69..5641c3a 100644 --- a/runzip.c +++ b/runzip.c @@ -282,10 +282,10 @@ i64 runzip_fd(int fd_in, int fd_out, int fd_hist, i64 expected_size) int i, j; memcpy(md5_stored, md5_resblock, MD5_DIGEST_SIZE); - if (unlikely(lseek(fd_out, 0, SEEK_SET) == -1)) - fatal("Failed to lseek fd_out in runzip_fd\n"); - if (unlikely((md5_fstream = fdopen(fd_out, "r")) == NULL)) - fatal("Failed to fdopen fd_out in runzip_fd\n"); + if (unlikely(lseek(fd_hist, 0, SEEK_SET) == -1)) + fatal("Failed to lseek fd_hist in runzip_fd\n"); + if (unlikely((md5_fstream = fdopen(fd_hist, "r")) == NULL)) + fatal("Failed to fdopen fd_hist in runzip_fd\n"); if (unlikely(md5_stream(md5_fstream, md5_resblock))) fatal("Failed to md5_stream in runzip_fd\n"); /* We dont' close the file here as it's closed in main */