diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -107,7 +107,6 @@ #include #include #include -#include #include #include #include @@ -353,7 +352,8 @@ break; } xo_close_container("ndp"); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); exit(0); } @@ -917,16 +917,16 @@ static void usage(void) { - printf("usage: ndp [-nt] hostname\n"); - printf(" ndp [-nt] -a | -c | -p | -r | -H | -P | -R\n"); - printf(" ndp [-nt] -A wait\n"); - printf(" ndp [-nt] -d hostname\n"); - printf(" ndp [-nt] -f filename\n"); - printf(" ndp [-nt] -i interface [flags...]\n"); + xo_error("usage: ndp [-nt] hostname\n"); + xo_error(" ndp [-nt] -a | -c | -p | -r | -H | -P | -R\n"); + xo_error(" ndp [-nt] -A wait\n"); + xo_error(" ndp [-nt] -d hostname\n"); + xo_error(" ndp [-nt] -f filename\n"); + xo_error(" ndp [-nt] -i interface [flags...]\n"); #ifdef SIOCSDEFIFACE_IN6 - printf(" ndp [-nt] -I [interface|delete]\n"); + xo_error(" ndp [-nt] -I [interface|delete]\n"); #endif - printf(" ndp [-nt] -s nodename etheraddr [temp] [proxy]\n"); + xo_error(" ndp [-nt] -s nodename etheraddr [temp] [proxy]\n"); exit(1); } diff --git a/usr.sbin/ndp/ndp_netlink.c b/usr.sbin/ndp/ndp_netlink.c --- a/usr.sbin/ndp/ndp_netlink.c +++ b/usr.sbin/ndp/ndp_netlink.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -42,7 +41,6 @@ #include #include -#include #include "ndp.h" #define RTF_ANNOUNCE RTF_PROTO2 @@ -56,12 +54,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