Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/blacklist/lib portability fixes.
details: https://anonhg.NetBSD.org/src/rev/5fad131c8de2
branches: trunk
changeset: 335713:5fad131c8de2
user: christos <christos%NetBSD.org@localhost>
date: Thu Jan 22 02:42:56 2015 +0000
description:
portability fixes.
diffstat:
external/bsd/blacklist/lib/bl.c | 20 ++++++++++++++++----
external/bsd/blacklist/lib/blacklist.c | 11 ++++++++---
2 files changed, 24 insertions(+), 7 deletions(-)
diffs (112 lines):
diff -r 40bec3fede03 -r 5fad131c8de2 external/bsd/blacklist/lib/bl.c
--- a/external/bsd/blacklist/lib/bl.c Thu Jan 22 02:42:27 2015 +0000
+++ b/external/bsd/blacklist/lib/bl.c Thu Jan 22 02:42:56 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bl.c,v 1.9 2015/01/22 01:39:18 christos Exp $ */
+/* $NetBSD: bl.c,v 1.10 2015/01/22 02:42:56 christos Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -28,8 +28,14 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#include "port.h"
+#endif
+
#include <sys/cdefs.h>
-__RCSID("$NetBSD: bl.c,v 1.9 2015/01/22 01:39:18 christos Exp $");
+__RCSID("$NetBSD: bl.c,v 1.10 2015/01/22 02:42:56 christos Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -43,6 +49,7 @@
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
+#include <stdint.h>
#include <stdbool.h>
#include "bl.h"
@@ -93,7 +100,9 @@
/* AF_UNIX address of local logger */
struct sockaddr_un sun = {
.sun_family = AF_LOCAL,
+#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
.sun_len = sizeof(sun),
+#endif
};
mode_t om;
int rv;
@@ -127,8 +136,10 @@
fcntl(b->b_fd, F_SETFL, fcntl(b->b_fd, F_GETFL) | O_NONBLOCK);
#endif
#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)
+#endif
#endif
}
@@ -271,7 +282,6 @@
bl_message_t bl;
char buf[512];
} ub;
- int *fd;
ssize_t rlen;
bl_info_t *bi = &b->b_info;
@@ -309,6 +319,7 @@
}
memcpy(&bi->bi_fd, CMSG_DATA(cmsg), sizeof(bi->bi_fd));
break;
+#ifdef SCM_CREDS
case SCM_CREDS:
#ifdef SOCKCREDSIZE
sc = (void *)CMSG_DATA(cmsg);
@@ -316,6 +327,7 @@
#else
#endif
break;
+#endif
default:
(*b->b_fun)(LOG_ERR, "%s: unexpected cmsg_type %d",
__func__, cmsg->cmsg_type);
diff -r 40bec3fede03 -r 5fad131c8de2 external/bsd/blacklist/lib/blacklist.c
--- a/external/bsd/blacklist/lib/blacklist.c Thu Jan 22 02:42:27 2015 +0000
+++ b/external/bsd/blacklist/lib/blacklist.c Thu Jan 22 02:42:56 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: blacklist.c,v 1.1 2015/01/21 16:16:00 christos Exp $ */
+/* $NetBSD: blacklist.c,v 1.2 2015/01/22 02:42:56 christos Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -28,8 +28,13 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#include "port.h"
+#endif
+
#include <sys/cdefs.h>
-__RCSID("$NetBSD: blacklist.c,v 1.1 2015/01/21 16:16:00 christos Exp $");
+__RCSID("$NetBSD: blacklist.c,v 1.2 2015/01/22 02:42:56 christos Exp $");
#include <stdio.h>
#include <bl.h>
@@ -59,7 +64,7 @@
}
static void
-dlog(int level, const char *fmt, ...)
+dlog(int level __unused, const char *fmt, ...)
{
char buf[BUFSIZ];
va_list ap;
Home |
Main Index |
Thread Index |
Old Index