зеркало из https://github.com/github/ruby.git
* 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:
Родитель
c13142643d
Коммит
79a3b7797f
|
@ -1,3 +1,9 @@
|
|||
Fri Apr 9 23:51:45 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* 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]
|
||||
|
||||
Fri Apr 9 21:22:10 2010 Keiju Ishitsuka <keiju@ruby-lang.org>
|
||||
|
||||
* lib/irb/completion.rb (CompletionProc): irb will be stuck with
|
||||
|
|
|
@ -104,8 +104,13 @@ init_inetsock_internal(struct inetsock_arg *arg)
|
|||
|
||||
arg->fd = -1;
|
||||
|
||||
if (type == INET_SERVER)
|
||||
listen(fd, 5);
|
||||
if (type == INET_SERVER) {
|
||||
status = listen(fd, 5);
|
||||
if (status < 0) {
|
||||
close(fd);
|
||||
syscall = "listen(2)";
|
||||
}
|
||||
}
|
||||
|
||||
/* create new instance */
|
||||
return rsock_init_sock(arg->sock, fd);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче