aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_install/lib/msg.c
diff options
context:
space:
mode:
authorPhilippe Charnier <charnier@FreeBSD.org>1997-10-08 07:48:21 +0000
committerPhilippe Charnier <charnier@FreeBSD.org>1997-10-08 07:48:21 +0000
commit6fed414929a595c4f33ab6c19535307ff4b9b787 (patch)
tree7bcf1819b90d1844ff07ddc14881ba7e2f0d94cb /usr.sbin/pkg_install/lib/msg.c
parent4586e1abc5b800ef9a7c314189e3f5abea90d12d (diff)
Notes
Diffstat (limited to 'usr.sbin/pkg_install/lib/msg.c')
-rw-r--r--usr.sbin/pkg_install/lib/msg.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/usr.sbin/pkg_install/lib/msg.c b/usr.sbin/pkg_install/lib/msg.c
index e35aba8c071d..032320bf61e2 100644
--- a/usr.sbin/pkg_install/lib/msg.c
+++ b/usr.sbin/pkg_install/lib/msg.c
@@ -1,5 +1,6 @@
#ifndef lint
-static const char *rcsid = "$Id$";
+static const char rcsid[] =
+ "$Id: msg.c,v 1.8 1997/02/22 16:09:50 peter Exp $";
#endif
/*
@@ -23,44 +24,18 @@ static const char *rcsid = "$Id$";
*
*/
+#include <err.h>
#include "lib.h"
/* Die a relatively simple death */
void
upchuck(const char *err)
{
- fprintf(stderr, "Fatal error during execution: ");
- perror(err);
+ warn("fatal error during execution: %s", err);
cleanup(0);
exit(1);
}
-/* Die a more complex death */
-void
-barf(const char *err, ...)
-{
- va_list args;
-
- va_start(args, err);
- vfprintf(stderr, err, args);
- fputc('\n', stderr);
- va_end(args);
- cleanup(0);
- exit(2);
-}
-
-/* Get annoyed about something but don't go to pieces over it */
-void
-whinge(const char *err, ...)
-{
- va_list args;
-
- va_start(args, err);
- vfprintf(stderr, err, args);
- fputc('\n', stderr);
- va_end(args);
-}
-
/*
* As a yes/no question, prompting from the varargs string and using
* default if user just hits return.
@@ -79,7 +54,7 @@ y_or_n(Boolean def, const char *msg, ...)
*/
tty = fopen("/dev/tty", "r");
if (!tty)
- barf("Can't open /dev/tty!\n");
+ cleanup(0), errx(2, "can't open /dev/tty!");
while (ch != 'Y' && ch != 'N') {
vfprintf(stderr, msg, args);
if (def)