зеркало из https://github.com/github/ruby.git
forgot to commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
344dcc25be
Коммит
a36ea435d2
|
@ -1255,16 +1255,16 @@ addrinfo_mload(VALUE self, VALUE ary)
|
|||
#ifdef HAVE_SYS_UN_H
|
||||
case AF_UNIX:
|
||||
{
|
||||
struct sockaddr_un sun;
|
||||
memset(&sun, 0, sizeof(sun));
|
||||
sun.sun_family = AF_UNIX;
|
||||
struct sockaddr_un uaddr;
|
||||
memset(&uaddr, 0, sizeof(uaddr));
|
||||
uaddr.sun_family = AF_UNIX;
|
||||
|
||||
StringValue(v);
|
||||
if (sizeof(sun.sun_path) <= (size_t)RSTRING_LEN(v))
|
||||
if (sizeof(uaddr.sun_path) <= (size_t)RSTRING_LEN(v))
|
||||
rb_raise(rb_eSocket, "too long AF_UNIX path");
|
||||
memcpy(sun.sun_path, RSTRING_PTR(v), RSTRING_LEN(v));
|
||||
len = sizeof(sun);
|
||||
memcpy(&ss, &sun, len);
|
||||
memcpy(uaddr.sun_path, RSTRING_PTR(v), RSTRING_LEN(v));
|
||||
len = sizeof(uaddr);
|
||||
memcpy(&ss, &uaddr, len);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче