Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/blacklist/test Add ability to test using a loca...
details: https://anonhg.NetBSD.org/src/rev/88660689171e
branches: trunk
changeset: 338587:88660689171e
user: christos <christos%NetBSD.org@localhost>
date: Sat May 30 22:40:38 2015 +0000
description:
Add ability to test using a local socket.
diffstat:
external/bsd/blacklist/test/Makefile | 3 ++-
external/bsd/blacklist/test/srvtest.c | 16 ++++++++++++++--
2 files changed, 16 insertions(+), 3 deletions(-)
diffs (68 lines):
diff -r 27c34981e9da -r 88660689171e external/bsd/blacklist/test/Makefile
--- a/external/bsd/blacklist/test/Makefile Sat May 30 22:40:17 2015 +0000
+++ b/external/bsd/blacklist/test/Makefile Sat May 30 22:40:38 2015 +0000
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile,v 1.2 2015/01/22 05:03:52 christos Exp $
+# $NetBSD: Makefile,v 1.3 2015/05/30 22:40:38 christos Exp $
MKMAN=no
PROGS=srvtest cltest
SRCS.srvtest = srvtest.c
SRCS.cltest = cltest.c
+CPPFLAGS+=-DBLDEBUG
LDADD+=-lutil
DPADD+=${LIBUTIL}
diff -r 27c34981e9da -r 88660689171e external/bsd/blacklist/test/srvtest.c
--- a/external/bsd/blacklist/test/srvtest.c Sat May 30 22:40:17 2015 +0000
+++ b/external/bsd/blacklist/test/srvtest.c Sat May 30 22:40:38 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: srvtest.c,v 1.9 2015/01/22 05:35:55 christos Exp $ */
+/* $NetBSD: srvtest.c,v 1.10 2015/05/30 22:40:38 christos Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: srvtest.c,v 1.9 2015/01/22 05:35:55 christos Exp $");
+__RCSID("$NetBSD: srvtest.c,v 1.10 2015/05/30 22:40:38 christos Exp $");
#include <sys/types.h>
#include <sys/socket.h>
@@ -49,6 +49,10 @@
#include <err.h>
#include "blacklist.h"
+#ifdef BLDEBUG
+#include "bl.h"
+static void *b;
+#endif
#ifndef INFTIM
#define INFTIM -1
@@ -66,7 +70,11 @@
err(1, "read");
buffer[sizeof(buffer) - 1] = '\0';
printf("%s: sending %d %s\n", getprogname(), afd, buffer);
+#ifdef BLDEBUG
+ blacklist_r(b, 1, afd, buffer);
+#else
blacklist(1, afd, buffer);
+#endif
exit(0);
}
@@ -177,6 +185,10 @@
signal(SIGCHLD, SIG_IGN);
+#ifdef BLDEBUG
+ b = bl_create(false, "blsock", vsyslog);
+#endif
+
while ((c = getopt(argc, argv, "up:")) != -1)
switch (c) {
case 'u':
Home |
Main Index |
Thread Index |
Old Index