1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/socket/ipsocket.c (init_inetsock_internal),

ext/socket/unixsocket.c (rsock_init_unixsock): check the result of
  listen(2).  based on a patch from Mike Pomraning.  [ruby-core:23698]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2010-04-09 14:53:19 +00:00
parent c13142643d
commit 79a3b7797f
3 changed files with 19 additions and 3 deletions

View file

@ -65,7 +65,12 @@ rsock_init_unixsock(VALUE sock, VALUE path, int server)
rb_sys_fail(sockaddr.sun_path);
}
if (server) listen(fd, 5);
if (server) {
if (listen(fd, 5) < 0) {
close(fd);
rb_sys_fail("listen(2)");
}
}
rsock_init_sock(sock, fd);
if (server) {