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

ruby-changes:11111

From: akr <ko1@a...>
Date: Mon, 2 Mar 2009 21:14:48 +0900 (JST)
Subject: [ruby-changes:11111] Ruby:r22710 (trunk): * ext/socket/ancdata.c (rsock_discard_cmsg_resource): defined

akr	2009-03-02 21:14:35 +0900 (Mon, 02 Mar 2009)

  New Revision: 22710

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

  Log:
    * ext/socket/ancdata.c (rsock_discard_cmsg_resource): defined
      unconditionally.

  Modified files:
    trunk/ChangeLog
    trunk/ext/socket/ancdata.c
    trunk/test/socket/test_socket.rb
    trunk/test/socket/test_unix.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 22709)
+++ ChangeLog	(revision 22710)
@@ -1,3 +1,8 @@
+Mon Mar  2 21:13:42 2009  Tanaka Akira  <akr@f...>
+
+	* ext/socket/ancdata.c (rsock_discard_cmsg_resource): defined
+	  unconditionally.
+
 Mon Mar  2 21:06:40 2009  Tanaka Akira  <akr@f...>
 
 	* ext/socket/raddrinfo.c (addrinfo_mload): don't use "sun" variable
Index: ext/socket/ancdata.c
===================================================================
--- ext/socket/ancdata.c	(revision 22709)
+++ ext/socket/ancdata.c	(revision 22710)
@@ -1387,10 +1387,12 @@
         }
     }
 }
+#endif
 
 void
 rsock_discard_cmsg_resource(struct msghdr *mh)
 {
+#if defined(HAVE_ST_MSG_CONTROL)
     struct cmsghdr *cmh;
     char *msg_end;
 
@@ -1402,8 +1404,8 @@
     for (cmh = CMSG_FIRSTHDR(mh); cmh != NULL; cmh = CMSG_NXTHDR(mh, cmh)) {
         discard_cmsg(cmh, msg_end);
     }
+#endif
 }
-#endif
 
 #if defined(HAVE_ST_MSG_CONTROL)
 static void
Index: test/socket/test_unix.rb
===================================================================
--- test/socket/test_unix.rb	(revision 22709)
+++ test/socket/test_unix.rb	(revision 22710)
@@ -69,6 +69,7 @@
   def test_fd_passing_n2
     io_ary = []
     return if !defined?(Socket::SCM_RIGHTS)
+    return if !defined?(Socket::AncillaryData)
     io_ary.concat IO.pipe
     io_ary.concat IO.pipe
     io_ary.concat IO.pipe
Index: test/socket/test_socket.rb
===================================================================
--- test/socket/test_socket.rb	(revision 22709)
+++ test/socket/test_socket.rb	(revision 22710)
@@ -312,6 +312,7 @@
 
   def test_timestamp
     return if /linux|freebsd|netbsd|openbsd|solaris|darwin/ !~ RUBY_PLATFORM
+    return if !defined?(Socket::AncillaryData)
     t1 = Time.now.strftime("%Y-%m-%d")
     stamp = nil
     Addrinfo.udp("127.0.0.1", 0).bind {|s1|

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

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