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

ruby-changes:41172

From: naruse <ko1@a...>
Date: Tue, 22 Dec 2015 22:45:26 +0900 (JST)
Subject: [ruby-changes:41172] naruse:r53244 (trunk): fix r53231: raise Errno::EBADF like other OSes

naruse	2015-12-22 22:45:14 +0900 (Tue, 22 Dec 2015)

  New Revision: 53244

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

  Log:
    fix r53231: raise Errno::EBADF like other OSes

  Modified files:
    trunk/ext/socket/init.c
Index: ext/socket/init.c
===================================================================
--- ext/socket/init.c	(revision 53243)
+++ ext/socket/init.c	(revision 53244)
@@ -61,8 +61,10 @@ rsock_init_sock(VALUE sock, int fd) https://github.com/ruby/ruby/blob/trunk/ext/socket/init.c#L61
 {
     rb_io_t *fp;
 
-    if (!is_socket(fd))
-        rb_raise(rb_eArgError, "not a socket file descriptor");
+    if (!is_socket(fd)) {
+	errno = EBADF;
+	rb_sys_fail("not a socket file descriptor");
+    }
 
     rb_update_max_fd(fd);
     MakeOpenFile(sock, fp);

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

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