mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-26 20:12:44 +00:00
arp(8): Complete libxo transition
Reviewed by: des MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41408
This commit is contained in:
parent
aaa302d17f
commit
417842f908
@ -55,7 +55,6 @@
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <netdb.h>
|
||||
#include <nlist.h>
|
||||
@ -169,7 +168,8 @@ main(int argc, char *argv[])
|
||||
|
||||
xo_close_list("arp-cache");
|
||||
xo_close_container("arp");
|
||||
xo_finish();
|
||||
if (xo_finish() < 0)
|
||||
xo_err(1, "stdout");
|
||||
} else {
|
||||
if (argc != 1)
|
||||
usage();
|
||||
@ -206,7 +206,7 @@ main(int argc, char *argv[])
|
||||
if (ifnameindex != NULL)
|
||||
if_freenameindex(ifnameindex);
|
||||
|
||||
return (rtn);
|
||||
exit(rtn);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -446,7 +446,8 @@ get(char *host)
|
||||
|
||||
xo_close_list("arp-cache");
|
||||
xo_close_container("arp");
|
||||
xo_finish();
|
||||
if (xo_finish() < 0)
|
||||
xo_err(1, "stdout");
|
||||
|
||||
return (found == 0);
|
||||
}
|
||||
@ -723,7 +724,7 @@ nuke_entries(uint32_t ifindex, struct in_addr addr)
|
||||
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]",
|
||||
|
@ -2,7 +2,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <netdb.h>
|
||||
|
||||
@ -43,12 +42,12 @@ nl_init_socket(struct snl_state *ss)
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user