diff options
author | apb <apb@pkgsrc.org> | 2008-02-27 23:50:29 +0000 |
---|---|---|
committer | apb <apb@pkgsrc.org> | 2008-02-27 23:50:29 +0000 |
commit | 438f574aec201fc066f63fe5ad53d1343f44223d (patch) | |
tree | 8bfcf9d89f0aee747a05d1492738c30c54d1a5b2 /net/3proxy | |
parent | 010f15462475100bb97279336ef9dd31f4bc09a7 (diff) | |
download | pkgsrc-438f574aec201fc066f63fe5ad53d1343f44223d.tar.gz |
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 (limited to 'net/3proxy')
-rw-r--r-- | net/3proxy/Makefile | 3 | ||||
-rw-r--r-- | net/3proxy/distinfo | 4 | ||||
-rw-r--r-- | net/3proxy/patches/patch-ad | 27 | ||||
-rw-r--r-- | net/3proxy/patches/patch-ae | 13 |
4 files changed, 45 insertions, 2 deletions
diff --git a/net/3proxy/Makefile b/net/3proxy/Makefile index 2d543cbbca5..087e482600a 100644 --- a/net/3proxy/Makefile +++ b/net/3proxy/Makefile @@ -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 --git a/net/3proxy/distinfo b/net/3proxy/distinfo index 64b15e47e93..af507a6f2a2 100644 --- a/net/3proxy/distinfo +++ b/net/3proxy/distinfo @@ -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 @@ Size (3proxy-0.5.3k.tgz) = 190797 bytes SHA1 (patch-aa) = e84a56ce0ce1fc82c982fb0e78ea14986035e0a0 SHA1 (patch-ab) = 681c7b0b29ad6fb652b3fa8bcecc2af563589c4f SHA1 (patch-ac) = caff37ccb6018152d11f6ce5c682f8cec4feff9b +SHA1 (patch-ad) = e5ebc2defdf5a79ff21e37101ddbee5f212d64f1 +SHA1 (patch-ae) = 03b9d88bd316fda6b812bbe29dbe471a652cfe91 diff --git a/net/3proxy/patches/patch-ad b/net/3proxy/patches/patch-ad new file mode 100644 index 00000000000..201b685eaa9 --- /dev/null +++ b/net/3proxy/patches/patch-ad @@ -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 --git a/net/3proxy/patches/patch-ae b/net/3proxy/patches/patch-ae new file mode 100644 index 00000000000..f7e4435be51 --- /dev/null +++ b/net/3proxy/patches/patch-ae @@ -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 |