* 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
This commit is contained in:
parent
3e7c24fe6e
commit
2f2b6ace05
@ -1,3 +1,8 @@
|
|||||||
|
Sat Aug 7 19:04:49 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* missing/close.c: undef the macros "getpeername", "getsockname" and
|
||||||
|
"shutdown" to prevent infinite recursion.
|
||||||
|
|
||||||
Sat Aug 7 18:37:39 2010 Tanaka Akira <akr@fsij.org>
|
Sat Aug 7 18:37:39 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* missing/close.c: undef the macro "close" to prevent infinite
|
* missing/close.c: undef the macro "close" to prevent infinite
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
|
#undef getpeername
|
||||||
int
|
int
|
||||||
ruby_getpeername(int s, struct sockaddr * name,
|
ruby_getpeername(int s, struct sockaddr * name,
|
||||||
socklen_t * namelen)
|
socklen_t * namelen)
|
||||||
@ -21,6 +22,7 @@ ruby_getpeername(int s, struct sockaddr * name,
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef getsockname
|
||||||
int
|
int
|
||||||
ruby_getsockname(int s, struct sockaddr * name,
|
ruby_getsockname(int s, struct sockaddr * name,
|
||||||
socklen_t * namelen)
|
socklen_t * namelen)
|
||||||
@ -37,6 +39,7 @@ ruby_getsockname(int s, struct sockaddr * name,
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef shutdown
|
||||||
int
|
int
|
||||||
ruby_shutdown(int s, int how)
|
ruby_shutdown(int s, int how)
|
||||||
{
|
{
|
||||||
@ -52,12 +55,12 @@ ruby_shutdown(int s, int how)
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef close
|
||||||
int
|
int
|
||||||
ruby_close(int s)
|
ruby_close(int s)
|
||||||
{
|
{
|
||||||
int err = errno;
|
int err = errno;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
#undef close
|
|
||||||
s = close(s);
|
s = close(s);
|
||||||
if (errno == ECONNRESET) {
|
if (errno == ECONNRESET) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user