Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/traceroute6 correct use of perror().



details:   https://anonhg.NetBSD.org/src/rev/6773dd582df3
branches:  trunk
changeset: 483522:6773dd582df3
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sun Mar 12 02:42:43 2000 +0000

description:
correct use of perror().

diffstat:

 usr.sbin/traceroute6/traceroute6.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (61 lines):

diff -r 39e1feead3c8 -r 6773dd582df3 usr.sbin/traceroute6/traceroute6.c
--- a/usr.sbin/traceroute6/traceroute6.c        Sun Mar 12 01:45:01 2000 +0000
+++ b/usr.sbin/traceroute6/traceroute6.c        Sun Mar 12 02:42:43 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: traceroute6.c,v 1.9 2000/03/02 07:43:32 itojun Exp $   */
+/*     $NetBSD: traceroute6.c,v 1.10 2000/03/12 02:42:43 itojun Exp $  */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -78,7 +78,7 @@
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: traceroute6.c,v 1.9 2000/03/02 07:43:32 itojun Exp $");
+__RCSID("$NetBSD: traceroute6.c,v 1.10 2000/03/12 02:42:43 itojun Exp $");
 #endif
 #endif
 
@@ -528,7 +528,7 @@
        datalen += sizeof(struct opacket);
        outpacket = (struct opacket *)malloc((unsigned)datalen);
        if (! outpacket) {
-               perror("traceroute6: malloc");
+               perror("malloc");
                exit(1);
        }
        (void) bzero((char *)outpacket, datalen);
@@ -537,7 +537,7 @@
         * Receive ICMP
         */
        if ((rcvsock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) {
-               perror("traceroute6: icmp socket");
+               perror("socket(ICMPv6)");
                exit(5);
        }
        /* initialize msghdr for receiving packets */
@@ -621,13 +621,13 @@
         * Send UDP
         */
        if ((sndsock = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
-               perror("traceroute6: udp socket");
+               perror("socket(SOCK_DGRAM)");
                exit(5);
        }
 #ifdef SO_SNDBUF
        if (setsockopt(sndsock, SOL_SOCKET, SO_SNDBUF, (char *)&datalen,
                       sizeof(datalen)) < 0) {
-               perror("traceroute6: SO_SNDBUF");
+               perror("setsockopt(SO_SNDBUF)");
                exit(6);
        }
 #endif /* SO_SNDBUF */
@@ -725,7 +725,7 @@
        Src.sin6_family = AF_INET6;
        Src.sin6_port = htons(ident);
        if (bind(sndsock, (struct sockaddr *)src, sizeof(Src))  < 0){
-               perror ("traceroute6: bind:");
+               perror("bind");
                exit (1);
        }
 



Home | Main Index | Thread Index | Old Index