mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/socket/socket.c (rsock_sys_fail_raddrinfo): Renamed from
rsock_sys_fail_addrinfo. (rsock_sys_fail_raddrinfo_or_sockaddr): Renamed from rsock_sys_fail_addrinfo_or_sockaddr. * ext/socket/rubysocket.h: Follow the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
67fe038d8f
commit
d818a6ab40
3 changed files with 18 additions and 9 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
Sat Apr 6 20:17:51 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* ext/socket/socket.c (rsock_sys_fail_raddrinfo): Renamed from
|
||||||
|
rsock_sys_fail_addrinfo.
|
||||||
|
(rsock_sys_fail_raddrinfo_or_sockaddr): Renamed from
|
||||||
|
rsock_sys_fail_addrinfo_or_sockaddr.
|
||||||
|
|
||||||
|
* ext/socket/rubysocket.h: Follow the above change.
|
||||||
|
|
||||||
Sat Apr 6 19:24:59 2013 Tanaka Akira <akr@fsij.org>
|
Sat Apr 6 19:24:59 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/socket/socket.c (rsock_sys_fail_sockaddr): Takes struct sockaddr
|
* ext/socket/socket.c (rsock_sys_fail_sockaddr): Takes struct sockaddr
|
||||||
|
|
|
@ -343,7 +343,7 @@ void rsock_init_socket_init(void);
|
||||||
NORETURN(void rsock_sys_fail_host_port(const char *, VALUE, VALUE));
|
NORETURN(void rsock_sys_fail_host_port(const char *, VALUE, VALUE));
|
||||||
NORETURN(void rsock_sys_fail_path(const char *, VALUE));
|
NORETURN(void rsock_sys_fail_path(const char *, VALUE));
|
||||||
NORETURN(void rsock_sys_fail_sockaddr(const char *, struct sockaddr *addr, socklen_t len));
|
NORETURN(void rsock_sys_fail_sockaddr(const char *, struct sockaddr *addr, socklen_t len));
|
||||||
NORETURN(void rsock_sys_fail_addrinfo(const char *, VALUE rai));
|
NORETURN(void rsock_sys_fail_raddrinfo(const char *, VALUE rai));
|
||||||
NORETURN(void rsock_sys_fail_sockaddr_or_addrinfo(const char *, VALUE addr, VALUE rai));
|
NORETURN(void rsock_sys_fail_raddrinfo_or_sockaddr(const char *, VALUE addr, VALUE rai));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -53,11 +53,11 @@ rsock_sys_fail_sockaddr(const char *mesg, struct sockaddr *addr, socklen_t len)
|
||||||
|
|
||||||
rai = rsock_addrinfo_new(addr, len, PF_UNSPEC, 0, 0, Qnil, Qnil);
|
rai = rsock_addrinfo_new(addr, len, PF_UNSPEC, 0, 0, Qnil, Qnil);
|
||||||
|
|
||||||
rsock_sys_fail_addrinfo(mesg, rai);
|
rsock_sys_fail_raddrinfo(mesg, rai);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rsock_sys_fail_addrinfo(const char *mesg, VALUE rai)
|
rsock_sys_fail_raddrinfo(const char *mesg, VALUE rai)
|
||||||
{
|
{
|
||||||
VALUE str, message;
|
VALUE str, message;
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ rsock_sys_fail_addrinfo(const char *mesg, VALUE rai)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rsock_sys_fail_addrinfo_or_sockaddr(const char *mesg, VALUE addr, VALUE rai)
|
rsock_sys_fail_raddrinfo_or_sockaddr(const char *mesg, VALUE addr, VALUE rai)
|
||||||
{
|
{
|
||||||
if (NIL_P(rai)) {
|
if (NIL_P(rai)) {
|
||||||
StringValue(addr);
|
StringValue(addr);
|
||||||
|
@ -77,7 +77,7 @@ rsock_sys_fail_addrinfo_or_sockaddr(const char *mesg, VALUE addr, VALUE rai)
|
||||||
(socklen_t)RSTRING_LEN(addr)); /* overflow should be checked already */
|
(socklen_t)RSTRING_LEN(addr)); /* overflow should be checked already */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
rsock_sys_fail_addrinfo(mesg, rai);
|
rsock_sys_fail_raddrinfo(mesg, rai);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -384,7 +384,7 @@ sock_connect(VALUE sock, VALUE addr)
|
||||||
fd = fptr->fd;
|
fd = fptr->fd;
|
||||||
n = rsock_connect(fd, (struct sockaddr*)RSTRING_PTR(addr), RSTRING_SOCKLEN(addr), 0);
|
n = rsock_connect(fd, (struct sockaddr*)RSTRING_PTR(addr), RSTRING_SOCKLEN(addr), 0);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
rsock_sys_fail_addrinfo_or_sockaddr("connect(2)", addr, rai);
|
rsock_sys_fail_raddrinfo_or_sockaddr("connect(2)", addr, rai);
|
||||||
}
|
}
|
||||||
|
|
||||||
return INT2FIX(n);
|
return INT2FIX(n);
|
||||||
|
@ -447,7 +447,7 @@ sock_connect_nonblock(VALUE sock, VALUE addr)
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
if (errno == EINPROGRESS)
|
if (errno == EINPROGRESS)
|
||||||
rb_mod_sys_fail(rb_mWaitWritable, "connect(2) would block");
|
rb_mod_sys_fail(rb_mWaitWritable, "connect(2) would block");
|
||||||
rsock_sys_fail_addrinfo_or_sockaddr("connect(2)", addr, rai);
|
rsock_sys_fail_raddrinfo_or_sockaddr("connect(2)", addr, rai);
|
||||||
}
|
}
|
||||||
|
|
||||||
return INT2FIX(n);
|
return INT2FIX(n);
|
||||||
|
@ -548,7 +548,7 @@ sock_bind(VALUE sock, VALUE addr)
|
||||||
SockAddrStringValueWithAddrinfo(addr, rai);
|
SockAddrStringValueWithAddrinfo(addr, rai);
|
||||||
GetOpenFile(sock, fptr);
|
GetOpenFile(sock, fptr);
|
||||||
if (bind(fptr->fd, (struct sockaddr*)RSTRING_PTR(addr), RSTRING_SOCKLEN(addr)) < 0)
|
if (bind(fptr->fd, (struct sockaddr*)RSTRING_PTR(addr), RSTRING_SOCKLEN(addr)) < 0)
|
||||||
rsock_sys_fail_addrinfo_or_sockaddr("bind(2)", addr, rai);
|
rsock_sys_fail_raddrinfo_or_sockaddr("bind(2)", addr, rai);
|
||||||
|
|
||||||
return INT2FIX(0);
|
return INT2FIX(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue