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

ruby-changes:38497

From: usa <ko1@a...>
Date: Thu, 21 May 2015 13:59:27 +0900 (JST)
Subject: [ruby-changes:38497] usa:r50578 (ruby_2_1): merge revision(s) 50404, 50405: [Backport #10975]

usa	2015-05-21 13:59:03 +0900 (Thu, 21 May 2015)

  New Revision: 50578

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

  Log:
    merge revision(s) 50404,50405: [Backport #10975]
    
    * ext/socket/ipsocket.c (init_inetsock_internal): preserve errno
      before other library calls and use rb_syserr_fail.
      [ruby-core:68531] [Bug #10975]

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/ext/socket/ipsocket.c
    branches/ruby_2_1/version.h
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 50577)
+++ ruby_2_1/ChangeLog	(revision 50578)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Thu May 21 13:57:47 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/socket/ipsocket.c (init_inetsock_internal): preserve errno
+	  before other library calls and use rb_syserr_fail.
+	  [ruby-core:68531] [Bug #10975]
+
 Thu May 21 13:32:52 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/-test-/printf/printf.c (uint_to_str): renamed to get rid of
Index: ruby_2_1/ext/socket/ipsocket.c
===================================================================
--- ruby_2_1/ext/socket/ipsocket.c	(revision 50577)
+++ ruby_2_1/ext/socket/ipsocket.c	(revision 50578)
@@ -41,6 +41,7 @@ inetsock_cleanup(struct inetsock_arg *ar https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/socket/ipsocket.c#L41
 static VALUE
 init_inetsock_internal(struct inetsock_arg *arg)
 {
+    int error = 0;
     int type = arg->type;
     struct addrinfo *res, *lres;
     int fd, status = 0, local = 0;
@@ -80,6 +81,7 @@ init_inetsock_internal(struct inetsock_a https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/socket/ipsocket.c#L81
 	syscall = "socket(2)";
 	fd = status;
 	if (fd < 0) {
+	    error = errno;
 	    continue;
 	}
 	arg->fd = fd;
@@ -107,6 +109,7 @@ init_inetsock_internal(struct inetsock_a https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/socket/ipsocket.c#L109
 	}
 
 	if (status < 0) {
+	    error = errno;
 	    close(fd);
 	    arg->fd = fd = -1;
 	    continue;
@@ -124,7 +127,7 @@ init_inetsock_internal(struct inetsock_a https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/socket/ipsocket.c#L127
 	    port = arg->remote.serv;
 	}
 
-	rsock_sys_fail_host_port(syscall, host, port);
+	rsock_syserr_fail_host_port(error, syscall, host, port);
     }
 
     arg->fd = -1;
@@ -132,8 +135,9 @@ init_inetsock_internal(struct inetsock_a https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/socket/ipsocket.c#L135
     if (type == INET_SERVER) {
 	status = listen(fd, SOMAXCONN);
 	if (status < 0) {
+	    error = errno;
 	    close(fd);
-            rb_sys_fail("listen(2)");
+	    rb_syserr_fail(error, "listen(2)");
 	}
     }
 
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 50577)
+++ ruby_2_1/version.h	(revision 50578)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.7"
 #define RUBY_RELEASE_DATE "2015-05-21"
-#define RUBY_PATCHLEVEL 351
+#define RUBY_PATCHLEVEL 352
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 5

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r50404-50405


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

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