summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-26 21:33:34 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-26 21:33:34 +0000
commit26bb9abfb883294bce86a165311e087516d3c89a (patch)
treed0430e7b4a56151779d973806099c99442291563
parente33718d47b4087bd7f088fb3966b3b97334ccde6 (diff)
err() cleanup; andrushock@korovino.net
-rw-r--r--usr.sbin/ndp/ndp.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c
index 6ff5e493699..07c56bc49e2 100644
--- a/usr.sbin/ndp/ndp.c
+++ b/usr.sbin/ndp/ndp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ndp.c,v 1.28 2003/06/26 21:32:01 deraadt Exp $ */
+/* $OpenBSD: ndp.c,v 1.29 2003/06/26 21:33:33 deraadt Exp $ */
/* $KAME: ndp.c,v 1.101 2002/07/17 08:46:33 itojun Exp $ */
/*
@@ -95,17 +95,17 @@
#include <arpa/inet.h>
-#include <netdb.h>
+#include <stdio.h>
#include <errno.h>
+#include <fcntl.h>
+#include <netdb.h>
#include <nlist.h>
-#include <stdio.h>
-#include <string.h>
#include <paths.h>
-#include <err.h>
#include <stdlib.h>
-#include <fcntl.h>
+#include <string.h>
#include <unistd.h>
#include <err.h>
+
#include "gmt2local.h"
/* packing rule for routing socket */
@@ -350,7 +350,7 @@ getsocket(void)
if (s < 0) {
s = socket(PF_ROUTE, SOCK_RAW, 0);
if (s < 0) {
- err(1, "ndp: socket");
+ err(1, "socket");
/* NOTREACHED */
}
}
@@ -598,7 +598,7 @@ again:;
err(1, "sysctl(PF_ROUTE estimate)");
if (needed > 0) {
if ((buf = malloc(needed)) == NULL)
- errx(1, "malloc");
+ err(1, "malloc");
if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0)
err(1, "sysctl(PF_ROUTE, NET_RT_FLAGS)");
lim = buf + needed;
@@ -1033,8 +1033,8 @@ rtrlist(void)
/*NOTREACHED*/
}
buf = malloc(l);
- if (!buf) {
- errx(1, "not enough core");
+ if (buf == NULL) {
+ err(1, "malloc");
/*NOTREACHED*/
}
if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), buf, &l, NULL, 0) < 0) {
@@ -1130,8 +1130,8 @@ plist(void)
/*NOTREACHED*/
}
buf = malloc(l);
- if (!buf) {
- errx(1, "not enough core");
+ if (buf == NULL) {
+ err(1, "malloc");
/*NOTREACHED*/
}
if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), buf, &l, NULL, 0) < 0) {