diff options
author | apb <apb> | 2008-02-27 23:50:29 +0000 |
---|---|---|
committer | apb <apb> | 2008-02-27 23:50:29 +0000 |
commit | cba85035dbe1dfbf6125004736b3a44d0996b71e (patch) | |
tree | 8bfcf9d89f0aee747a05d1492738c30c54d1a5b2 /net/3proxy/patches | |
parent | 77c1d708a4904bf6ea88ef4f12db08f29f295de2 (diff) | |
download | pkgsrc-cba85035dbe1dfbf6125004736b3a44d0996b71e.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/patches')
-rw-r--r-- | net/3proxy/patches/patch-ad | 27 | ||||
-rw-r--r-- | net/3proxy/patches/patch-ae | 13 |
2 files changed, 40 insertions, 0 deletions
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 |