Page MenuHomeFreeBSD

D41417.id125848.diff
No OneTemporary

D41417.id125848.diff

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,7 @@
#include <stdio.h>
#include <string.h>
#include <paths.h>
-#include <err.h>
+
#include <stdint.h>
#include <stdlib.h>
#include <fcntl.h>
@@ -208,7 +208,7 @@
argc = xo_parse_args(argc, argv);
if (argc < 0)
- exit(1);
+ exit(EXIT_FAILURE);
xo_set_version(NDP_XO_VERSION);
xo_open_container("ndp");
@@ -231,7 +231,7 @@
arg = NULL;
break;
case 'f':
- exit(file(optarg) ? 1 : 0);
+ exit(file(optarg) ? EXIT_FAILURE : EXIT_SUCCESS);
case 'd':
case 'i':
if (mode) {
@@ -322,7 +322,7 @@
case 's':
if (argc < 2 || argc > 4)
usage();
- exit(set(argc, argv) ? 1 : 0);
+ exit(set(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
case 'H':
if (argc != 0) {
usage();
@@ -353,8 +353,9 @@
break;
}
xo_close_container("ndp");
- xo_finish();
- exit(0);
+ if (xo_finish() < 0)
+ xo_err(EXIT_FAILURE, "stdout");
+ exit(EXIT_SUCCESS);
}
/*
@@ -927,7 +928,7 @@
printf(" ndp [-nt] -I [interface|delete]\n");
#endif
printf(" ndp [-nt] -s nodename etheraddr [temp] [proxy]\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
#ifdef WITHOUT_NETLINK
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,7 @@
#include <stdio.h>
#include <string.h>
#include <paths.h>
-#include <err.h>
+
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
@@ -42,7 +42,7 @@
#include <netlink/netlink_snl_route_compat.h>
#include <netlink/netlink_snl_route_parsers.h>
-#include <libxo/xo.h>
+
#include "ndp.h"
#define RTF_ANNOUNCE RTF_PROTO2
@@ -56,12 +56,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

File Metadata

Mime Type
text/plain
Expires
Thu, Feb 26, 3:04 AM (16 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28999913
Default Alt Text
D41417.id125848.diff (2 KB)

Event Timeline