Dirk Mueller
0563f3791b
- psm-errno.patch: avoid losing errno from failures to unpack archive OBS-URL: https://build.opensuse.org/request/show/180684 OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=270
29 lines
958 B
Diff
29 lines
958 B
Diff
Index: lib/psm.c
|
|
===================================================================
|
|
--- lib/psm.c
|
|
+++ lib/psm.c
|
|
@@ -807,6 +807,7 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
|
|
case PSM_PROCESS:
|
|
if (psm->goal == PKG_INSTALL) {
|
|
int fsmrc = 0;
|
|
+ int saved_errno = 0;
|
|
|
|
rpmpsmNotify(psm, RPMCALLBACK_INST_START, 0);
|
|
/* make sure first progress call gets made */
|
|
@@ -826,6 +827,7 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
|
|
|
|
fsmrc = rpmfsmRun(FSM_PKGINSTALL, psm->ts, psm->te, psm->fi,
|
|
payload, psm, NULL, &psm->failedFile);
|
|
+ saved_errno = errno;
|
|
|
|
rpmswAdd(rpmtsOp(psm->ts, RPMTS_OP_UNCOMPRESS),
|
|
fdOp(payload, FDSTAT_READ));
|
|
@@ -843,6 +845,7 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
|
|
rpmpsmNotify(psm, RPMCALLBACK_INST_STOP, psm->total);
|
|
|
|
if (fsmrc) {
|
|
+ errno = saved_errno;
|
|
rpmlog(RPMLOG_ERR,
|
|
_("unpacking of archive failed%s%s: %s\n"),
|
|
(psm->failedFile != NULL ? _(" on file ") : ""),
|