From 8fa094ff025302bc7d1fbf6b591732244454a8f7 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 18 Feb 2009 03:15:37 +0100 Subject: [PATCH] unpack: check rv and also errno, not rv twice! --HG-- extra : convert_revision : f30a7c3135c05f55e6b6d6acd50f17d79e623c85 --- lib/unpack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/unpack.c b/lib/unpack.c index 9a867e8a38f..f7dd832d034 100644 --- a/lib/unpack.c +++ b/lib/unpack.c @@ -204,7 +204,7 @@ unpack_archive_fini(struct archive *ar, const char *destdir, int flags, archive_entry_set_pathname(entry, buf); rv = archive_read_extract(ar, entry, lflags); - if (rv != 0 && rv != EEXIST) + if (rv != 0 && errno != EEXIST) break; if ((rv = xbps_file_exec(buf, destdir, "pre", @@ -222,12 +222,12 @@ unpack_archive_fini(struct archive *ar, const char *destdir, int flags, * Extract all data from the archive now. */ rv = archive_read_extract(ar, entry, lflags); - if (rv != 0 && rv != EEXIST) { + if (rv != 0 && errno != EEXIST) { printf("ERROR: couldn't unpack %s (%s), exiting!\n", archive_entry_pathname(entry), strerror(errno)); (void)fflush(stdout); break; - } else if (rv == EEXIST) { + } else if (rv != 0 && errno == EEXIST) { if (flags & XBPS_UNPACK_VERBOSE) { printf("WARNING: ignoring existent path: %s.\n", archive_entry_pathname(entry));