mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* thread_pthread.c (rb_thread_create_timer_thread): Added error
check when failing fcntl(). [Bug #6147] [ruby-dev:45364] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c7c7dfd2fc
commit
1a2ef6bae3
2 changed files with 13 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri May 18 17:39:42 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
|
* thread_pthread.c (rb_thread_create_timer_thread): Added error
|
||||||
|
check when failing fcntl(). [Bug #6147] [ruby-dev:45364]
|
||||||
|
|
||||||
Fri May 18 17:41:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri May 18 17:41:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/extmk.rb (extmake): link archives only, skip script only
|
* ext/extmk.rb (extmake): link archives only, skip script only
|
||||||
|
|
|
@ -1252,14 +1252,18 @@ rb_thread_create_timer_thread(void)
|
||||||
}
|
}
|
||||||
rb_update_max_fd(timer_thread_pipe[0]);
|
rb_update_max_fd(timer_thread_pipe[0]);
|
||||||
rb_update_max_fd(timer_thread_pipe[1]);
|
rb_update_max_fd(timer_thread_pipe[1]);
|
||||||
#if defined(HAVE_FCNTL) && defined(F_GETFL) && defined(F_SETFL)
|
#if defined(HAVE_FCNTL) && defined(F_GETFL) && defined(F_SETFL) && defined(O_NONBLOCK)
|
||||||
{
|
{
|
||||||
int oflags;
|
int oflags;
|
||||||
#if defined(O_NONBLOCK)
|
int err;
|
||||||
|
|
||||||
oflags = fcntl(timer_thread_pipe[1], F_GETFL);
|
oflags = fcntl(timer_thread_pipe[1], F_GETFL);
|
||||||
|
if (oflags == -1)
|
||||||
|
rb_sys_fail(0);
|
||||||
oflags |= O_NONBLOCK;
|
oflags |= O_NONBLOCK;
|
||||||
fcntl(timer_thread_pipe[1], F_SETFL, oflags);
|
err = fcntl(timer_thread_pipe[1], F_SETFL, oflags);
|
||||||
#endif /* defined(O_NONBLOCK) */
|
if (err == -1)
|
||||||
|
rb_sys_fail(0);
|
||||||
}
|
}
|
||||||
#endif /* defined(HAVE_FCNTL) && defined(F_GETFL) && defined(F_SETFL) */
|
#endif /* defined(HAVE_FCNTL) && defined(F_GETFL) && defined(F_SETFL) */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue