File psm-errno.diff of Package rpm

--- lib/psm.c.orig	2013-07-12 12:25:38.000000000 +0000
+++ lib/psm.c	2013-07-12 12:27:01.000000000 +0000
@@ -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 = rpmPackageFilesInstall(psm->ts, psm->te, psm->fi,
 				  payload, psm, &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 ") : ""),