mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
2 changed files with 9 additions and 1 deletions
|
@ -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>
|
||||
|
||||
* missing/close.c: undef the macro "close" to prevent infinite
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue