1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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:
akr 2009-03-02 12:13:00 +00:00
parent 344dcc25be
commit a36ea435d2

View file

@ -1255,16 +1255,16 @@ addrinfo_mload(VALUE self, VALUE ary)
#ifdef HAVE_SYS_UN_H #ifdef HAVE_SYS_UN_H
case AF_UNIX: case AF_UNIX:
{ {
struct sockaddr_un sun; struct sockaddr_un uaddr;
memset(&sun, 0, sizeof(sun)); memset(&uaddr, 0, sizeof(uaddr));
sun.sun_family = AF_UNIX; uaddr.sun_family = AF_UNIX;
StringValue(v); 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"); rb_raise(rb_eSocket, "too long AF_UNIX path");
memcpy(sun.sun_path, RSTRING_PTR(v), RSTRING_LEN(v)); memcpy(uaddr.sun_path, RSTRING_PTR(v), RSTRING_LEN(v));
len = sizeof(sun); len = sizeof(uaddr);
memcpy(&ss, &sun, len); memcpy(&ss, &uaddr, len);
break; break;
} }
#endif #endif