Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/blacklist more portability
details: https://anonhg.NetBSD.org/src/rev/6a80897d0216
branches: trunk
changeset: 335715:6a80897d0216
user: christos <christos%NetBSD.org@localhost>
date: Thu Jan 22 02:48:24 2015 +0000
description:
more portability
diffstat:
external/bsd/blacklist/lib/bl.c | 9 ++++++---
external/bsd/blacklist/port/sockaddr_snprintf.c | 11 +++++++++--
2 files changed, 15 insertions(+), 5 deletions(-)
diffs (93 lines):
diff -r 6d2df3600a4e -r 6a80897d0216 external/bsd/blacklist/lib/bl.c
--- a/external/bsd/blacklist/lib/bl.c Thu Jan 22 02:45:10 2015 +0000
+++ b/external/bsd/blacklist/lib/bl.c Thu Jan 22 02:48:24 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bl.c,v 1.10 2015/01/22 02:42:56 christos Exp $ */
+/* $NetBSD: bl.c,v 1.11 2015/01/22 02:48:24 christos Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: bl.c,v 1.10 2015/01/22 02:42:56 christos Exp $");
+__RCSID("$NetBSD: bl.c,v 1.11 2015/01/22 02:48:24 christos Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -46,6 +46,7 @@
#include <stdio.h>
#include <string.h>
#include <syslog.h>
+#include <signal.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
@@ -138,7 +139,9 @@
#if SOCK_NOSIGPIPE == 0
#ifdef SO_NOSIGPIPE
int o = 1;
- setsockopt(b->b_fd, SOL_SOCKET, SO_NOSIGPIPE, &o, sizeof(o)
+ setsockopt(b->b_fd, SOL_SOCKET, SO_NOSIGPIPE, &o, sizeof(o));
+#else
+ signal(SIGPIPE, SIG_IGN);
#endif
#endif
}
diff -r 6d2df3600a4e -r 6a80897d0216 external/bsd/blacklist/port/sockaddr_snprintf.c
--- a/external/bsd/blacklist/port/sockaddr_snprintf.c Thu Jan 22 02:45:10 2015 +0000
+++ b/external/bsd/blacklist/port/sockaddr_snprintf.c Thu Jan 22 02:48:24 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sockaddr_snprintf.c,v 1.4 2015/01/22 02:45:10 christos Exp $ */
+/* $NetBSD: sockaddr_snprintf.c,v 1.5 2015/01/22 02:48:24 christos Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
#endif
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: sockaddr_snprintf.c,v 1.4 2015/01/22 02:45:10 christos Exp $");
+__RCSID("$NetBSD: sockaddr_snprintf.c,v 1.5 2015/01/22 02:48:24 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -43,6 +43,9 @@
#include <sys/un.h>
#include <netinet/in.h>
+#ifdef __linux__
+#undef HAVE_NETATALK_AT_H
+#endif
#ifdef HAVE_NETATALK_AT_H
#include <netatalk/at.h>
#endif
@@ -208,6 +211,7 @@
p = ntohs(sin6->sin6_port);
a = &sin6->sin6_addr;
break;
+#ifdef HAVE_NET_IF_DL_H
case AF_LINK:
sdl = ((const struct sockaddr_dl *)(const void *)sa);
(void)strlcpy(addr = abuf, link_ntoa(sdl), sizeof(abuf));
@@ -216,6 +220,7 @@
addr = w;
}
break;
+#endif
default:
errno = EAFNOSUPPORT;
return -1;
@@ -339,9 +344,11 @@
case AF_INET6:
debug_in6(nbuf, sizeof(nbuf), sin6);
break;
+#ifdef NET_IF_DL_H
case AF_LINK:
debug_dl(nbuf, sizeof(nbuf), sdl);
break;
+#endif
default:
abort();
}
Home |
Main Index |
Thread Index |
Old Index