summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-19 01:33:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-19 01:33:49 +0000
commit7594a99322d95040637b3b46ee81bf53592bf40a (patch)
treec5629f9d935f1cc242d5f7aaf0aca8108edb6616 /ext
parent3ef4dfdcf6896e33329a9847beba0f3e71bd88b4 (diff)
init.c: glibc bug
* ext/socket/init.c (rsock_raise_socket_error): get rid of a glibc bug. [ruby-core:71100] [Bug #11600] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/socket/init.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/socket/init.c b/ext/socket/init.c
index 00e20fa308..1710129519 100644
--- a/ext/socket/init.c
+++ b/ext/socket/init.c
@@ -35,7 +35,9 @@ void
rsock_raise_socket_error(const char *reason, int error)
{
#ifdef EAI_SYSTEM
- if (error == EAI_SYSTEM) rb_sys_fail(reason);
+ int e;
+ if (error == EAI_SYSTEM && (e = errno) != 0)
+ rb_syserr_fail(e, reason);
#endif
rb_raise(rb_eSocket, "%s: %s", reason, gai_strerror(error));
}