summaryrefslogtreecommitdiff
path: root/usr.bin/sudo/interfaces.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-04-03 19:15:35 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-04-03 19:15:35 +0000
commit7d1bac92416230d9ee85e1a890ead0683d0948f6 (patch)
treeefd7bd51fa1e440c0cf7c099ebc14195ff0b333a /usr.bin/sudo/interfaces.c
parenta8c1bd16fee3bf5fff45987e8ba0ef7a281ede93 (diff)
Sync with my sudo cvs repo:
o update to sudo 1.6.7p2 o use warn/err throughout
Diffstat (limited to 'usr.bin/sudo/interfaces.c')
-rw-r--r--usr.bin/sudo/interfaces.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/sudo/interfaces.c b/usr.bin/sudo/interfaces.c
index f50a0c509cc..9f5c5cf8aa7 100644
--- a/usr.bin/sudo/interfaces.c
+++ b/usr.bin/sudo/interfaces.c
@@ -73,13 +73,16 @@ struct rtentry;
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_ERR_H
+# include <err.h>
+#else
+# include "emul/err.h"
+#endif /* HAVE_ERR_H */
#include <netdb.h>
-#include <errno.h>
#ifdef _ISC
# include <sys/stream.h>
# include <sys/sioctl.h>
# include <sys/stropts.h>
-# include <net/errno.h>
# define STRSET(cmd, param, len) {strioctl.ic_cmd=(cmd);\
strioctl.ic_dp=(param);\
strioctl.ic_timout=0;\
@@ -99,7 +102,7 @@ struct rtentry;
#include "interfaces.h"
#ifndef lint
-static const char rcsid[] = "$Sudo: interfaces.c,v 1.68 2003/03/15 20:31:02 millert Exp $";
+static const char rcsid[] = "$Sudo: interfaces.c,v 1.69 2003/04/02 18:25:19 millert Exp $";
#endif /* lint */
@@ -186,11 +189,8 @@ load_interfaces()
#endif /* _ISC */
sock = socket(AF_INET, SOCK_DGRAM, 0);
- if (sock < 0) {
- (void) fprintf(stderr, "%s: cannot open socket: %s\n",
- Argv[0], strerror(errno));
- exit(1);
- }
+ if (sock < 0)
+ err(1, "cannot open socket");
/*
* Get interface configuration or return (leaving num_interfaces == 0)
@@ -324,5 +324,5 @@ dump_interfaces()
puts("Local IP address and netmask pairs:");
for (i = 0; i < num_interfaces; i++)
printf("\t%s / 0x%x\n", inet_ntoa(interfaces[i].addr),
- ntohl(interfaces[i].netmask.s_addr));
+ (unsigned int)ntohl(interfaces[i].netmask.s_addr));
}