pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/3proxy Calling usleep for 1000000 microseconds or ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/00128a3a2bcc
branches:  trunk
changeset: 539113:00128a3a2bcc
user:      apb <apb%pkgsrc.org@localhost>
date:      Wed Feb 27 23:50:29 2008 +0000

description:
Calling usleep for 1000000 microseconds or more is not allowed,
so add a myusleep() wrapper to DTRT.  This should fix the 100% CPU
utilisation.

PKGREVISION -> 1.

diffstat:

 net/3proxy/Makefile         |   3 ++-
 net/3proxy/distinfo         |   4 +++-
 net/3proxy/patches/patch-ad |  27 +++++++++++++++++++++++++++
 net/3proxy/patches/patch-ae |  13 +++++++++++++
 4 files changed, 45 insertions(+), 2 deletions(-)

diffs (77 lines):

diff -r c28783ea5ddf -r 00128a3a2bcc net/3proxy/Makefile
--- a/net/3proxy/Makefile       Wed Feb 27 22:31:52 2008 +0000
+++ b/net/3proxy/Makefile       Wed Feb 27 23:50:29 2008 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.1 2008/02/27 16:14:25 apb Exp $
+# $NetBSD: Makefile,v 1.2 2008/02/27 23:50:29 apb Exp $
 #
 
 DISTNAME=      3proxy-0.5.3k
 PKGNAME=       ${DISTNAME:C/k$/.11/}
+PKGREVISION=   1
 CATEGORIES=    net
 MASTER_SITES=  http://3proxy.ru/${DISTNAME:S/3proxy-//}/
 EXTRACT_SUFX=  .tgz
diff -r c28783ea5ddf -r 00128a3a2bcc net/3proxy/distinfo
--- a/net/3proxy/distinfo       Wed Feb 27 22:31:52 2008 +0000
+++ b/net/3proxy/distinfo       Wed Feb 27 23:50:29 2008 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.1 2008/02/27 16:14:25 apb Exp $
+$NetBSD: distinfo,v 1.2 2008/02/27 23:50:29 apb Exp $
 
 SHA1 (3proxy-0.5.3k.tgz) = 71befdaa94867e4b54a5b24e2a3b3b33debd5e67
 RMD160 (3proxy-0.5.3k.tgz) = 416d3c0d870a6aa450472f4ab060ce90e3362dea
@@ -6,3 +6,5 @@
 SHA1 (patch-aa) = e84a56ce0ce1fc82c982fb0e78ea14986035e0a0
 SHA1 (patch-ab) = 681c7b0b29ad6fb652b3fa8bcecc2af563589c4f
 SHA1 (patch-ac) = caff37ccb6018152d11f6ce5c682f8cec4feff9b
+SHA1 (patch-ad) = e5ebc2defdf5a79ff21e37101ddbee5f212d64f1
+SHA1 (patch-ae) = 03b9d88bd316fda6b812bbe29dbe471a652cfe91
diff -r c28783ea5ddf -r 00128a3a2bcc net/3proxy/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/3proxy/patches/patch-ad       Wed Feb 27 23:50:29 2008 +0000
@@ -0,0 +1,27 @@
+$NetBSD: patch-ad,v 1.1 2008/02/27 23:50:29 apb Exp $
+
+--- src/common.c.orig  2008-01-08 18:57:30.000000000 +0200
++++ src/common.c
+@@ -606,3 +606,22 @@ unsigned long getip(unsigned char *name)
+ #endif
+       return retval;
+ }
++
++/*
++ * POSIX says:
++ *     The usleep() function may fail if:
++ *     [EINVAL] The time interval specified one million or more microseconds.
++ *
++ * Other code in 3proxy calls usleep with much larger arguments, but
++ * that gets redirected here via "#define usleep(usecs) myusleep(usecs)"
++ * in proxy.h.  We call sleep() for any whole number of seconds, and
++ * the real usleep() for any left over microseconds.
++ */
++int
++myusleep(useconds_t useconds)
++{
++    unsigned int secs = useconds / 1000000;
++    useconds = useconds % 1000000;
++    if (secs > 0) sleep(secs);
++    return (usleep)(useconds);
++}
diff -r c28783ea5ddf -r 00128a3a2bcc net/3proxy/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/3proxy/patches/patch-ae       Wed Feb 27 23:50:29 2008 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-ae,v 1.1 2008/02/27 23:50:29 apb Exp $
+
+--- src/proxy.h.orig   2006-09-21 14:32:05.000000000 +0200
++++ src/proxy.h
+@@ -95,6 +95,8 @@
+ #endif
+ #define daemonize() daemon(1,1)
+ #define SLEEPTIME 1000
++#define usleep(usecs) myusleep(usecs)
++int myusleep(useconds_t);
+ #ifndef O_BINARY
+ #define O_BINARY 0
+ #endif



Home | Main Index | Thread Index | Old Index