Module Name:    src
Committed By:   christos
Date:           Sat May 30 22:40:38 UTC 2015

Modified Files:
        src/external/bsd/blacklist/test: Makefile srvtest.c

Log Message:
Add ability to test using a local socket.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/blacklist/test/Makefile
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/blacklist/test/srvtest.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/blacklist/test/Makefile
diff -u src/external/bsd/blacklist/test/Makefile:1.2 src/external/bsd/blacklist/test/Makefile:1.3
--- src/external/bsd/blacklist/test/Makefile:1.2	Thu Jan 22 00:03:52 2015
+++ src/external/bsd/blacklist/test/Makefile	Sat May 30 18:40:38 2015
@@ -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}
 

Index: src/external/bsd/blacklist/test/srvtest.c
diff -u src/external/bsd/blacklist/test/srvtest.c:1.9 src/external/bsd/blacklist/test/srvtest.c:1.10
--- src/external/bsd/blacklist/test/srvtest.c:1.9	Thu Jan 22 00:35:55 2015
+++ src/external/bsd/blacklist/test/srvtest.c	Sat May 30 18:40:38 2015
@@ -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 @@ __RCSID("$NetBSD: srvtest.c,v 1.9 2015/0
 #include <err.h>
 
 #include "blacklist.h"
+#ifdef BLDEBUG
+#include "bl.h"
+static void *b;
+#endif
 
 #ifndef INFTIM
 #define INFTIM -1
@@ -66,7 +70,11 @@ process_tcp(int afd)
 		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 @@ main(int argc, char *argv[])
 
 	signal(SIGCHLD, SIG_IGN);
 
+#ifdef BLDEBUG
+	b = bl_create(false, "blsock", vsyslog);
+#endif
+
 	while ((c = getopt(argc, argv, "up:")) != -1)
 		switch (c) {
 		case 'u':

Reply via email to