[前][次][番号順一覧][スレッド一覧]

ruby-changes:26891

From: shugo <ko1@a...>
Date: Sat, 26 Jan 2013 08:34:11 +0900 (JST)
Subject: [ruby-changes:26891] shugo:r38943 (trunk): * ext/socket/raddrinfo (rsock_unix_sockaddr_len): renamed from

shugo	2013-01-26 08:33:50 +0900 (Sat, 26 Jan 2013)

  New Revision: 38943

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38943

  Log:
    * ext/socket/raddrinfo (rsock_unix_sockaddr_len): renamed from
      rsock_unixpath_len, because it returns not the length of the path,
      but the length of a socket address for the path.

  Modified files:
    trunk/ChangeLog
    trunk/ext/socket/raddrinfo.c
    trunk/ext/socket/rubysocket.h
    trunk/ext/socket/unixsocket.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38942)
+++ ChangeLog	(revision 38943)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jan 26 08:29:33 2013  Shugo Maeda  <shugo@r...>
+
+	* ext/socket/raddrinfo (rsock_unix_sockaddr_len): renamed from
+	  rsock_unixpath_len, because it returns not the length of the path,
+	  but the length of a socket address for the path.
+
 Sat Jan 26 01:12:23 2013  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* test/ruby/test_io.rb (test_ioctl_linux): skip if a platform is
Index: ext/socket/rubysocket.h
===================================================================
--- ext/socket/rubysocket.h	(revision 38942)
+++ ext/socket/rubysocket.h	(revision 38943)
@@ -240,7 +240,7 @@ int rsock_revlookup_flag(VALUE revlookup https://github.com/ruby/ruby/blob/trunk/ext/socket/rubysocket.h#L240
 #ifdef HAVE_SYS_UN_H
 VALUE rsock_unixpath_str(struct sockaddr_un *sockaddr, socklen_t len);
 VALUE rsock_unixaddr(struct sockaddr_un *sockaddr, socklen_t len);
-socklen_t rsock_unixpath_len(VALUE path);
+socklen_t rsock_unix_sockaddr_len(VALUE path);
 #endif
 
 int rsock_socket(int domain, int type, int proto);
Index: ext/socket/raddrinfo.c
===================================================================
--- ext/socket/raddrinfo.c	(revision 38942)
+++ ext/socket/raddrinfo.c	(revision 38943)
@@ -443,7 +443,7 @@ rsock_unixaddr(struct sockaddr_un *socka https://github.com/ruby/ruby/blob/trunk/ext/socket/raddrinfo.c#L443
 }
 
 socklen_t
-rsock_unixpath_len(VALUE path)
+rsock_unix_sockaddr_len(VALUE path)
 {
 #ifdef __linux__
     if (RSTRING_PTR(path)[0] == '\0') {
@@ -800,7 +800,7 @@ init_unix_addrinfo(rb_addrinfo_t *rai, V https://github.com/ruby/ruby/blob/trunk/ext/socket/raddrinfo.c#L800
     un.sun_family = AF_UNIX;
     memcpy((void*)&un.sun_path, RSTRING_PTR(path), RSTRING_LEN(path));
 
-    len = rsock_unixpath_len(path);
+    len = rsock_unix_sockaddr_len(path);
     init_addrinfo(rai, (struct sockaddr *)&un, len,
 		  PF_UNIX, socktype, 0, Qnil, Qnil);
 }
Index: ext/socket/unixsocket.c
===================================================================
--- ext/socket/unixsocket.c	(revision 38942)
+++ ext/socket/unixsocket.c	(revision 38943)
@@ -46,7 +46,7 @@ rsock_init_unixsock(VALUE sock, VALUE pa https://github.com/ruby/ruby/blob/trunk/ext/socket/unixsocket.c#L46
             RSTRING_LEN(path), (int)sizeof(sockaddr.sun_path));
     }
     memcpy(sockaddr.sun_path, RSTRING_PTR(path), RSTRING_LEN(path));
-    sockaddrlen = rsock_unixpath_len(path);
+    sockaddrlen = rsock_unix_sockaddr_len(path);
 
     if (server) {
         status = bind(fd, (struct sockaddr*)&sockaddr, sockaddrlen);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]