diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c --- a/usr.sbin/arp/arp.c +++ b/usr.sbin/arp/arp.c @@ -69,7 +69,6 @@ #include #include -#include #include #include #include @@ -185,7 +184,8 @@ xo_close_list("arp-cache"); xo_close_container("arp"); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); } else { if (argc != 1) usage(); @@ -222,7 +222,7 @@ if (ifnameindex != NULL) if_freenameindex(ifnameindex); - return (rtn); + exit(rtn); } /* @@ -462,7 +462,8 @@ xo_close_list("arp-cache"); xo_close_container("arp"); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); return (found == 0); } @@ -741,7 +742,7 @@ static void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n", + xo_error("%s\n%s\n%s\n%s\n%s\n%s\n%s\n", "usage: arp [-n] [-i interface] hostname", " arp [-n] [-i interface] -a", " arp -d hostname [pub]", diff --git a/usr.sbin/arp/arp_netlink.c b/usr.sbin/arp/arp_netlink.c --- a/usr.sbin/arp/arp_netlink.c +++ b/usr.sbin/arp/arp_netlink.c @@ -2,7 +2,6 @@ #include #include #include -#include #include #include @@ -43,12 +42,12 @@ if (modfind("netlink") == -1 && errno == ENOENT) { /* Try to load */ if (kldload("netlink") == -1) - err(1, "netlink is not loaded and load attempt failed"); + xo_err(1, "netlink is not loaded and load attempt failed"); if (snl_init(ss, NETLINK_ROUTE)) return; } - err(1, "unable to open netlink socket"); + xo_err(1, "unable to open netlink socket"); } static bool