Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/netstat Use warn() instead of warnx() and simplify.



details:   https://anonhg.NetBSD.org/src/rev/99d03783b27a
branches:  trunk
changeset: 372615:99d03783b27a
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Dec 12 05:09:33 2022 +0000

description:
Use warn() instead of warnx() and simplify.

diffstat:

 usr.bin/netstat/if.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (30 lines):

diff -r 32dd6bf8e06b -r 99d03783b27a usr.bin/netstat/if.c
--- a/usr.bin/netstat/if.c      Mon Dec 12 01:07:52 2022 +0000
+++ b/usr.bin/netstat/if.c      Mon Dec 12 05:09:33 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.107 2022/11/19 14:42:35 taca Exp $    */
+/*     $NetBSD: if.c,v 1.108 2022/12/12 05:09:33 msaitoh Exp $ */
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94";
 #else
-__RCSID("$NetBSD: if.c,v 1.107 2022/11/19 14:42:35 taca Exp $");
+__RCSID("$NetBSD: if.c,v 1.108 2022/12/12 05:09:33 msaitoh Exp $");
 #endif
 #endif /* not lint */
 
@@ -182,9 +182,8 @@
        snprintf(namebuf, sizeof(namebuf),
            "net.interfaces.%s.sndq.drops", ifname);
        len = sizeof(drops);
-       if (sysctlbyname(namebuf, &drops, &len, NULL, 0)
-           == -1) {
-               warnx("'%s' not found", namebuf);
+       if (sysctlbyname(namebuf, &drops, &len, NULL, 0) == -1) {
+               warn("%s", namebuf);
                dext->ifi_oqdrops = 0;
                return -1;
        } else



Home | Main Index | Thread Index | Old Index