diff options
author | jkh <jkh@FreeBSD.org> | 1997-10-13 15:03:55 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-10-13 15:03:55 +0000 |
commit | 4b318a582678d8f68d483f6a6e26bed4605e1bb2 (patch) | |
tree | 616a602eaba10b4a9566eeba12230e573af92805 /usr.sbin/pkg_install/lib/msg.c | |
parent | f71ea4919aca593ee0fd403a76ddb6b0113b7ba6 (diff) | |
download | FreeBSD-src-4b318a582678d8f68d483f6a6e26bed4605e1bb2.zip FreeBSD-src-4b318a582678d8f68d483f6a6e26bed4605e1bb2.tar.gz |
Don't return from cleanup() - if it's removed the playpen then very
bad things will happen if we return to unsuspecting code.
Noted to my great dismay by: Tim Vanderhoek <hoek@hwcn.org>
Diffstat (limited to 'usr.sbin/pkg_install/lib/msg.c')
-rw-r--r-- | usr.sbin/pkg_install/lib/msg.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/pkg_install/lib/msg.c b/usr.sbin/pkg_install/lib/msg.c index 032320b..3c2d199 100644 --- a/usr.sbin/pkg_install/lib/msg.c +++ b/usr.sbin/pkg_install/lib/msg.c @@ -1,6 +1,6 @@ #ifndef lint static const char rcsid[] = - "$Id: msg.c,v 1.8 1997/02/22 16:09:50 peter Exp $"; + "$Id: msg.c,v 1.9 1997/10/08 07:48:09 charnier Exp $"; #endif /* @@ -33,7 +33,6 @@ upchuck(const char *err) { warn("fatal error during execution: %s", err); cleanup(0); - exit(1); } /* @@ -53,8 +52,10 @@ y_or_n(Boolean def, const char *msg, ...) * collected on stdin */ tty = fopen("/dev/tty", "r"); - if (!tty) - cleanup(0), errx(2, "can't open /dev/tty!"); + if (!tty) { + warnx("can't open /dev/tty!"); + cleanup(0); + } while (ch != 'Y' && ch != 'N') { vfprintf(stderr, msg, args); if (def) |