mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
2 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
{
|
||||
struct afd *afd;
|
||||
struct servent *sp;
|
||||
struct hostent *hp;
|
||||
u_short port;
|
||||
int family, len, i;
|
||||
|
@ -177,7 +176,7 @@ getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen,
|
|||
strcpy(serv, numserv);
|
||||
} else {
|
||||
#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 (strlen(sp->s_name) + 1 > servlen)
|
||||
return ENI_MEMORY;
|
||||
|
|
|
@ -2428,6 +2428,7 @@ sock_initialize(VALUE sock, VALUE domain, VALUE type, VALUE protocol)
|
|||
return init_sock(sock, fd);
|
||||
}
|
||||
|
||||
#if defined HAVE_SOCKETPAIR
|
||||
static VALUE
|
||||
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));
|
||||
}
|
||||
#endif
|
||||
|
||||
static VALUE
|
||||
sock_s_socketpair(VALUE klass, VALUE domain, VALUE type, VALUE protocol)
|
||||
|
|
Loading…
Reference in a new issue