summaryrefslogtreecommitdiffstats
path: root/sbin/routed/rtquery
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>1999-05-05 06:15:30 +0000
committermarkm <markm@FreeBSD.org>1999-05-05 06:15:30 +0000
commitbc16aa792fd404aa1b15834552f6d90276eb786c (patch)
treef75effc2e371c91d4910ba53ae1817bb618a861c /sbin/routed/rtquery
parent60b9aebc2a93ae5ece544abb2518d1f46283d89a (diff)
downloadFreeBSD-src-bc16aa792fd404aa1b15834552f6d90276eb786c.zip
FreeBSD-src-bc16aa792fd404aa1b15834552f6d90276eb786c.tar.gz
Restore perror --> err changes.
Diffstat (limited to 'sbin/routed/rtquery')
-rw-r--r--sbin/routed/rtquery/rtquery.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/sbin/routed/rtquery/rtquery.c b/sbin/routed/rtquery/rtquery.c
index 25d9e82..2bcd76e 100644
--- a/sbin/routed/rtquery/rtquery.c
+++ b/sbin/routed/rtquery/rtquery.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: rtquery.c,v 1.10 1999/05/02 13:14:16 markm Exp $
*/
char copyright[] =
@@ -46,6 +46,7 @@ char copyright[] =
#define RIPVERSION RIPv2
#include <protocols/routed.h>
#include <arpa/inet.h>
+#include <err.h>
#include <netdb.h>
#include <errno.h>
#include <unistd.h>
@@ -62,7 +63,7 @@ static char sccsid[] __attribute__((unused))= "@(#)query.c 8.1 (Berkeley) 6/5/93
#elif defined(__NetBSD__)
__RCSID("$NetBSD: rtquery.c,v 1.10 1999/02/23 10:47:41 christos Exp $");
#endif
-#ident "$Revision: 2.17 $"
+#ident "$Revision: 1.10 $"
#ifndef sgi
#define _HAVE_SIN_LEN
@@ -274,8 +275,7 @@ main(int argc,
soc = socket(AF_INET, SOCK_DGRAM, 0);
if (soc < 0) {
- perror("socket");
- exit(2);
+ err(2, "socket");
}
/* be prepared to receive a lot of routes */
@@ -284,7 +284,7 @@ main(int argc,
&bsize, sizeof(bsize)) == 0)
break;
if (bsize <= 4*1024) {
- perror("setsockopt SO_RCVBUF");
+ warn("setsockopt SO_RCVBUF");
break;
}
}
@@ -338,8 +338,7 @@ trace_loop(char *argv[])
while (bind(soc, (struct sockaddr *)&myaddr, sizeof(myaddr)) < 0) {
if (errno != EADDRINUSE
|| myaddr.sin_port == 0) {
- perror("bind");
- exit(2);
+ err(2, "bind");
}
myaddr.sin_port = htons(ntohs(myaddr.sin_port)-1);
}
@@ -428,8 +427,7 @@ query_loop(char *argv[], int argc)
sizeof(imsg_buf.packet), 0,
(struct sockaddr *)&from, &fromlen);
if (cc < 0) {
- perror("recvfrom");
- exit(1);
+ err(1, "recvfrom");
}
/* count the distinct responding hosts.
* You cannot match responding hosts with
@@ -461,8 +459,7 @@ query_loop(char *argv[], int argc)
if (cc < 0) {
if (errno == EINTR)
continue;
- perror("select");
- exit(1);
+ err(1, "select");
}
/* After a pause in responses, probe another host.
@@ -480,8 +477,7 @@ query_loop(char *argv[], int argc)
/* or until we have waited a long time
*/
if (gettimeofday(&now, 0) < 0) {
- perror("gettimeofday(now)");
- exit(1);
+ err(1, "gettimeofday(now)");
}
if (sent.tv_sec + wtime <= now.tv_sec)
break;
@@ -501,8 +497,7 @@ out(const char *host)
struct hostent *hp;
if (gettimeofday(&sent, 0) < 0) {
- perror("gettimeofday(sent)");
- return -1;
+ err(-1, "gettimeofday(sent)");
}
memset(&router, 0, sizeof(router));
@@ -522,8 +517,7 @@ out(const char *host)
if (sendto(soc, &omsg_buf, omsg_len, 0,
(struct sockaddr *)&router, sizeof(router)) < 0) {
- perror(host);
- return -1;
+ err(-1, host);
}
return 0;
OpenPOWER on IntegriCloud