summaryrefslogtreecommitdiff
path: root/missing
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-07 10:05:37 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-07 10:05:37 +0000
commit2f2b6ace050bbabba106c80658068e3d40244bba (patch)
treefd1683f77846696e5c955e0639b8be135d8bfeb9 /missing
parent3e7c24fe6e4899619e3cf1c1c79b96cd361a13e2 (diff)
* missing/close.c: undef the macros "getpeername", "getsockname" and
"shutdown" to prevent infinite recursion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing')
-rw-r--r--missing/close.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/missing/close.c b/missing/close.c
index 8dc6928ffd..831e75efe1 100644
--- a/missing/close.c
+++ b/missing/close.c
@@ -5,6 +5,7 @@
#include <sys/types.h>
#include <sys/socket.h>
+#undef getpeername
int
ruby_getpeername(int s, struct sockaddr * name,
socklen_t * namelen)
@@ -21,6 +22,7 @@ ruby_getpeername(int s, struct sockaddr * name,
return s;
}
+#undef getsockname
int
ruby_getsockname(int s, struct sockaddr * name,
socklen_t * namelen)
@@ -37,6 +39,7 @@ ruby_getsockname(int s, struct sockaddr * name,
return s;
}
+#undef shutdown
int
ruby_shutdown(int s, int how)
{
@@ -52,12 +55,12 @@ ruby_shutdown(int s, int how)
return s;
}
+#undef close
int
ruby_close(int s)
{
int err = errno;
errno = 0;
-#undef close
s = close(s);
if (errno == ECONNRESET) {
errno = 0;