From e372c808d2acdb101de76f025b7047fe94a9a582 Mon Sep 17 00:00:00 2001 From: jbj Date: Sun, 20 Aug 2000 21:30:32 +0000 Subject: [PATCH] - fix: preserve cpio errno when using Fclose with libio. CVS patchset: 4096 CVS date: 2000/08/20 21:30:32 --- lib/install.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/install.c b/lib/install.c index c6fd63c..1a66e5a 100644 --- a/lib/install.c +++ b/lib/install.c @@ -507,6 +507,7 @@ static int installArchive(FD_t fd, struct fileInfo * files, char * rpmio_flags; FD_t cfd; int urltype; + int saveerrno; if (!files) { /* install all files */ @@ -571,12 +572,14 @@ static int installArchive(FD_t fd, struct fileInfo * files, rc = cpioInstallArchive(cfd, map, mappedFiles, ((notify && archiveSize) || specFile) ? callback : NULL, &info, &failedFile); + saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */ Fclose(cfd); headerFree(info.h); if (rc) { /* this would probably be a good place to check if disk space was used up - if so, we should return a different error */ + errno = saveerrno; /* XXX FIXME: Fclose with libio destroys errno */ rpmError(RPMERR_CPIO, _("unpacking of archive failed%s%s: %s"), (failedFile != NULL ? _(" on file ") : ""), (failedFile != NULL ? failedFile : ""), -- 2.7.4