* ext/socket/socket.c (io_call_close, io_close, pair_yield):
unused unless socketpair exists. * ext/socket/getnameinfo.c (getnameinfo): moved conditinally used variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
53716bfce7
commit
b5470fd243
@ -135,7 +135,6 @@ int
|
|||||||
getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags)
|
getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags)
|
||||||
{
|
{
|
||||||
struct afd *afd;
|
struct afd *afd;
|
||||||
struct servent *sp;
|
|
||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
u_short port;
|
u_short port;
|
||||||
int family, len, i;
|
int family, len, i;
|
||||||
@ -177,7 +176,7 @@ getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen,
|
|||||||
strcpy(serv, numserv);
|
strcpy(serv, numserv);
|
||||||
} else {
|
} else {
|
||||||
#if defined(HAVE_GETSERVBYPORT)
|
#if defined(HAVE_GETSERVBYPORT)
|
||||||
sp = getservbyport(port, (flags & NI_DGRAM) ? "udp" : "tcp");
|
struct servent *sp = getservbyport(port, (flags & NI_DGRAM) ? "udp" : "tcp");
|
||||||
if (sp) {
|
if (sp) {
|
||||||
if (strlen(sp->s_name) + 1 > servlen)
|
if (strlen(sp->s_name) + 1 > servlen)
|
||||||
return ENI_MEMORY;
|
return ENI_MEMORY;
|
||||||
|
@ -2428,6 +2428,7 @@ sock_initialize(VALUE sock, VALUE domain, VALUE type, VALUE protocol)
|
|||||||
return init_sock(sock, fd);
|
return init_sock(sock, fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined HAVE_SOCKETPAIR
|
||||||
static VALUE
|
static VALUE
|
||||||
io_call_close(VALUE io)
|
io_call_close(VALUE io)
|
||||||
{
|
{
|
||||||
@ -2445,6 +2446,7 @@ pair_yield(VALUE pair)
|
|||||||
{
|
{
|
||||||
return rb_ensure(rb_yield, pair, io_close, rb_ary_entry(pair, 1));
|
return rb_ensure(rb_yield, pair, io_close, rb_ary_entry(pair, 1));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
sock_s_socketpair(VALUE klass, VALUE domain, VALUE type, VALUE protocol)
|
sock_s_socketpair(VALUE klass, VALUE domain, VALUE type, VALUE protocol)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user