summaryrefslogtreecommitdiff
path: root/usr.bin/tip
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2015-06-16 22:54:10 +0000
committerchristos <christos@NetBSD.org>2015-06-16 22:54:10 +0000
commit43e4027d6de21c2acc8ad0e2774f0ea13325b8ab (patch)
tree75a690f3bc74c8425e3043124c7499a773694866 /usr.bin/tip
parent02c1e703ad45f9b170d11c46170c9471d8197905 (diff)
fix some error handling.
Diffstat (limited to 'usr.bin/tip')
-rw-r--r--usr.bin/tip/remote.c8
-rw-r--r--usr.bin/tip/tip.c14
2 files changed, 10 insertions, 12 deletions
diff --git a/usr.bin/tip/remote.c b/usr.bin/tip/remote.c
index fa267da35c6..82939ff5848 100644
--- a/usr.bin/tip/remote.c
+++ b/usr.bin/tip/remote.c
@@ -1,4 +1,4 @@
-/* $NetBSD: remote.c,v 1.19 2013/10/21 14:47:46 christos Exp $ */
+/* $NetBSD: remote.c,v 1.20 2015/06/16 22:54:11 christos Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993\
#if 0
static char sccsid[] = "@(#)remote.c 8.1 (Berkeley) 6/6/93";
#endif
-__RCSID("$NetBSD: remote.c,v 1.19 2013/10/21 14:47:46 christos Exp $");
+__RCSID("$NetBSD: remote.c,v 1.20 2015/06/16 22:54:11 christos Exp $");
#endif /* not lint */
#include "pathnames.h"
@@ -128,12 +128,12 @@ getremcap(char *host)
else
DU = cgetflag("du");
if (DV == NULL) {
- errx(3, "%s: missing device spec\n", host);
+ errx(3, "%s: missing device spec", host);
}
if (DU && CU == NULL)
CU = DV;
if (DU && PN == NULL) {
- errx(3, "%s: missing phone number\n", host);
+ errx(3, "%s: missing phone number", host);
}
HD = cgetflag("hd");
diff --git a/usr.bin/tip/tip.c b/usr.bin/tip/tip.c
index 0d0048a2b9f..18cd4117a8f 100644
--- a/usr.bin/tip/tip.c
+++ b/usr.bin/tip/tip.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tip.c,v 1.56 2015/06/11 18:12:00 gson Exp $ */
+/* $NetBSD: tip.c,v 1.57 2015/06/16 22:54:11 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\
#if 0
static char sccsid[] = "@(#)tip.c 8.1 (Berkeley) 6/6/93";
#endif
-__RCSID("$NetBSD: tip.c,v 1.56 2015/06/11 18:12:00 gson Exp $");
+__RCSID("$NetBSD: tip.c,v 1.57 2015/06/16 22:54:11 christos Exp $");
#endif /* not lint */
/*
@@ -91,8 +91,7 @@ main(int argc, char *argv[])
tipusage();
}
if (!isatty(0)) {
- (void)fprintf(stderr, "%s: must be interactive\n", getprogname());
- exit(1);
+ errx(EXIT_FAILURE, must be interactive");
}
cmdlineBR = 0;
@@ -151,11 +150,10 @@ notnumber:
(void)signal(SIGTERM, cleanup);
if ((i = hunt(System)) == 0) {
- (void)printf("all ports busy\n");
- exit(3);
+ errx(3, "all ports busy");
}
if (i == -1) {
- errx(3, "link down\n");
+ errx(3, "link down");
}
setbuf(stdout, NULL);
@@ -180,7 +178,7 @@ notnumber:
}
}
if ((q = tip_connect()) != NULL) {
- errx(1, "\07%s\n[EOT]\n", q);
+ errx(1, "\07%s\n[EOT]", q);
}
if (!HW) {
if (ttysetup((speed_t)number(value(BAUDRATE))) != 0) {