diff options
author | hubertf <hubertf@pkgsrc.org> | 2005-07-25 13:13:00 +0000 |
---|---|---|
committer | hubertf <hubertf@pkgsrc.org> | 2005-07-25 13:13:00 +0000 |
commit | fd107baf6b553399a7eca894772ca7dc4ea34567 (patch) | |
tree | 00f6b2aa502c8253a63a08bdb8ac10211d5ce16f /pkgtools/pkg_install | |
parent | 8539d90c9a77688ac51a44caae02cbe55175befa (diff) | |
download | pkgsrc-fd107baf6b553399a7eca894772ca7dc4ea34567.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/pkg_install')
-rw-r--r-- | pkgtools/pkg_install/files/add/perform.c | 15 |
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 |