pkgsrc/devel/sfslite/patches/patch-aa
2017-09-09 19:45:46 +00:00

45 lines
1.4 KiB
Text

$NetBSD: patch-aa,v 1.2 2017/09/09 19:45:46 dholland Exp $
Clean up %m abuse.
XXX: third hunk's purpose is unknown.
--- async/myaddrs.C.orig 2009-02-12 13:20:42.000000000 +0000
+++ async/myaddrs.C
@@ -41,7 +41,7 @@ myipaddrs (vec<in_addr> *res)
int s;
if ((s = socket (AF_INET, SOCK_DGRAM, 0)) < 0) {
- warn ("socket: %m\n");
+ warn ("socket: %s\n", strerror(errno));
return false;
}
@@ -53,7 +53,7 @@ myipaddrs (vec<in_addr> *res)
xfree (ifc.ifc_buf);
ifc.ifc_buf = (char *) xmalloc (ifc.ifc_len);
if (ioctl (s, SIOCGIFCONF, &ifc) < 0) {
- warn ("SIOCGIFCONF: %m\n");
+ warn ("SIOCGIFCONF: %s\n", strerror(errno));
close (s);
xfree (ifc.ifc_buf);
return false;
@@ -74,7 +74,7 @@ myipaddrs (vec<in_addr> *res)
res->clear ();
bhash<in_addr> addrs;
- p = ifc.ifc_buf;
+ p = (char *)(void *)ifc.ifc_buf;
e = p + ifc.ifc_len;
while (p < e) {
struct ifreq *ifrp = (struct ifreq *) p;
@@ -88,8 +88,8 @@ myipaddrs (vec<in_addr> *res)
if (ifrp->ifr_addr.sa_family != AF_INET)
continue;
if (ioctl (s, SIOCGIFFLAGS, &ifr) < 0) {
- warn ("SIOCGIFFLAGS (%.*s): %m\n", (int) sizeof (ifr.ifr_name),
- ifr.ifr_name);
+ warn ("SIOCGIFFLAGS (%.*s): %s\n", (int) sizeof (ifr.ifr_name),
+ ifr.ifr_name, strerror(errno));
continue;
}
in_addr a = ((struct sockaddr_in *) &ifrp->ifr_addr)->sin_addr;