Thu May 23 15:01:05 2013 UTC ()
remove obsolete libevent interface uses


(christos)
diff -r1.10 -r1.11 pkgsrc/net/unworkable/Makefile
diff -r1.1.1.1 -r1.2 pkgsrc/net/unworkable/distinfo
diff -r0 -r1.1 pkgsrc/net/unworkable/patches/patch-main.c

cvs diff -r1.10 -r1.11 pkgsrc/net/unworkable/Makefile (expand / switch to unified diff)

--- pkgsrc/net/unworkable/Makefile 2013/02/06 23:23:26 1.10
+++ pkgsrc/net/unworkable/Makefile 2013/05/23 15:01:05 1.11
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1# $NetBSD: Makefile,v 1.10 2013/02/06 23:23:26 jperkin Exp $ 1# $NetBSD: Makefile,v 1.11 2013/05/23 15:01:05 christos Exp $
2 2
3DISTNAME= unworkable-0.51 3DISTNAME= unworkable-0.51
4PKGREVISION= 6 4PKGREVISION= 7
5CATEGORIES= net 5CATEGORIES= net
6MASTER_SITES= # http://p2presearch.com/unworkable/dist/ 6MASTER_SITES= # http://p2presearch.com/unworkable/dist/
7 7
8MAINTAINER= agc@NetBSD.org 8MAINTAINER= agc@NetBSD.org
9HOMEPAGE= http://p2presearch.com/unworkable/ 9HOMEPAGE= http://p2presearch.com/unworkable/
10COMMENT= BSD-licensed command-line torrent client 10COMMENT= BSD-licensed command-line torrent client
11 11
12USE_TOOLS+= yacc 12USE_TOOLS+= yacc
13WRKSRC= ${WRKDIR}/unworkable 13WRKSRC= ${WRKDIR}/unworkable
14MAKE_FILE= BSDmakefile 14MAKE_FILE= BSDmakefile
15 15
16INSTALLATION_DIRS+= bin ${PKGMANDIR}/man1 ${PKGMANDIR}/cat1 16INSTALLATION_DIRS+= bin ${PKGMANDIR}/man1 ${PKGMANDIR}/cat1
17 17

cvs diff -r1.1.1.1 -r1.2 pkgsrc/net/unworkable/distinfo (expand / switch to unified diff)

--- pkgsrc/net/unworkable/distinfo 2009/01/19 05:40:39 1.1.1.1
+++ pkgsrc/net/unworkable/distinfo 2013/05/23 15:01:05 1.2
@@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
1$NetBSD: distinfo,v 1.1.1.1 2009/01/19 05:40:39 agc Exp $ 1$NetBSD: distinfo,v 1.2 2013/05/23 15:01:05 christos Exp $
2 2
3SHA1 (unworkable-0.51.tar.gz) = 0a179f7d84aa95df3fe30bd49806776826f8e4c6 3SHA1 (unworkable-0.51.tar.gz) = 0a179f7d84aa95df3fe30bd49806776826f8e4c6
4RMD160 (unworkable-0.51.tar.gz) = 72174941df30ab63101f334f0a657e1357f7309b 4RMD160 (unworkable-0.51.tar.gz) = 72174941df30ab63101f334f0a657e1357f7309b
5Size (unworkable-0.51.tar.gz) = 71020 bytes 5Size (unworkable-0.51.tar.gz) = 71020 bytes
6SHA1 (patch-aa) = c792177339cf79341c24cf9a12032ee98d564eaa 6SHA1 (patch-aa) = c792177339cf79341c24cf9a12032ee98d564eaa
 7SHA1 (patch-main.c) = d25ddad279f8143c4f15733f86c12f1074e43f0e

File Added: pkgsrc/net/unworkable/patches/Attic/patch-main.c
$NetBSD: patch-main.c,v 1.1 2013/05/23 15:01:05 christos Exp $
Replace event_gotsig and event_sigcb with proper signal access

--- main.c.orig	2008-09-27 16:35:43.000000000 -0400
+++ main.c	2013-05-23 10:58:29.000000000 -0400
@@ -40,13 +40,11 @@
 #define MESSAGE "hash check"
 #define METER "|/-\\"
 
-static void sighandler(int);
+static void addhandler(int);
 void usage(void);
 
 extern char *optarg;
 extern int  optind;
-extern int event_gotsig;
-extern int (*event_sigcb)(void);
 
 void
 usage(void)
@@ -56,9 +54,14 @@
 }
 
 static void
-sighandler(int sig)
+addhandler(int sig)
 {
-	event_gotsig = 1;
+	struct event sig_ev;
+	int got;
+
+	evsignal_set(&sig_ev, sig,
+	    (void (*)(evutil_socket_t, short, void *))terminate_handler, &got);
+	evsignal_add(&sig_ev, NULL);
 }
 
 int
@@ -76,10 +79,10 @@
 	GC_INIT();
 	#endif
 
-	signal(SIGHUP, sighandler);
-	signal(SIGABRT, sighandler);
-	signal(SIGINT, sighandler);
-	signal(SIGQUIT, sighandler);
+	addhandler(SIGHUP);
+	addhandler(SIGABRT);
+	addhandler(SIGINT);
+	addhandler(SIGQUIT);
 	/* don't die on sigpipe */
 	signal(SIGPIPE, SIG_IGN);
 	#if defined(__SVR4) && defined(__sun)
@@ -160,7 +163,7 @@
 
 	srandom(time(NULL));
 	network_init();
-	event_sigcb = terminate_handler;
+
 	network_start_torrent(torrent, rlp.rlim_cur);
 
 	exit(0);