summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorhubertf <hubertf>2005-07-25 13:13:00 +0000
committerhubertf <hubertf>2005-07-25 13:13:00 +0000
commit8426350c1b01f9f225c0a9a5617dba65936cf6c8 (patch)
tree00f6b2aa502c8253a63a08bdb8ac10211d5ce16f /pkgtools
parenta599f9fb005549aa8bfb90dd0a497b1609a80aa7 (diff)
downloadpkgsrc-8426350c1b01f9f225c0a9a5617dba65936cf6c8.tar.gz
Pull over change from src/usr.sbin/pkg_install:
| Modified Files: | src/usr.sbin/pkg_install/add: perform.c | | Log Message: | cleanup: preserve errno. Needed so err() functions ran after running | cleanup(0) print the correct error message. | | | To generate a diff of this commit: | cvs rdiff -r1.109 -r1.110 src/usr.sbin/pkg_install/add/perform.c
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_install/files/add/perform.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c
index 10613adddfb..fa57c4ffb40 100644
--- a/pkgtools/pkg_install/files/add/perform.c
+++ b/pkgtools/pkg_install/files/add/perform.c
@@ -1,4 +1,4 @@
-/* $NetBSD: perform.c,v 1.32 2005/07/18 09:14:04 hubertf Exp $ */
+/* $NetBSD: perform.c,v 1.33 2005/07/25 13:13:00 hubertf Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -11,7 +11,7 @@
#if 0
static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp";
#else
-__RCSID("$NetBSD: perform.c,v 1.32 2005/07/18 09:14:04 hubertf Exp $");
+__RCSID("$NetBSD: perform.c,v 1.33 2005/07/25 13:13:00 hubertf Exp $");
#endif
#endif
@@ -41,6 +41,9 @@ __RCSID("$NetBSD: perform.c,v 1.32 2005/07/18 09:14:04 hubertf Exp $");
#if HAVE_ERR_H
#include <err.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
#include "lib.h"
#include "add.h"
#include "verify.h"
@@ -1013,8 +1016,11 @@ void
cleanup(int signo)
{
static int alreadyCleaning;
- void (*oldint) (int);
- void (*oldhup) (int);
+ void (*oldint) (int);
+ void (*oldhup) (int);
+ int saved_errno;
+
+ saved_errno = errno;
oldint = signal(SIGINT, SIG_IGN);
oldhup = signal(SIGHUP, SIG_IGN);
@@ -1030,6 +1036,7 @@ cleanup(int signo)
}
signal(SIGINT, oldint);
signal(SIGHUP, oldhup);
+ errno = saved_errno;
}
int