* thread.c (rb_thread_blocking_region, rb_thread_blocking_region_end):
preserve errno. [Bug #2606] [ruby-core:28924] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
50fa45fb89
commit
59b91237c3
@ -1,3 +1,8 @@
|
|||||||
|
Mon Apr 19 23:14:45 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
|
* thread.c (rb_thread_blocking_region, rb_thread_blocking_region_end):
|
||||||
|
preserve errno. [Bug #2606] [ruby-core:28924]
|
||||||
|
|
||||||
Mon Apr 19 19:41:10 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
|
Mon Apr 19 19:41:10 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
|
||||||
|
|
||||||
* lib/fileutils.rb (FileUtils::cp_r): backport r11156 from ruby_1_8.
|
* lib/fileutils.rb (FileUtils::cp_r): backport r11156 from ruby_1_8.
|
||||||
|
5
thread.c
5
thread.c
@ -1054,10 +1054,12 @@ rb_thread_blocking_region_begin(void)
|
|||||||
void
|
void
|
||||||
rb_thread_blocking_region_end(struct rb_blocking_region_buffer *region)
|
rb_thread_blocking_region_end(struct rb_blocking_region_buffer *region)
|
||||||
{
|
{
|
||||||
|
int saved_errno = errno;
|
||||||
rb_thread_t *th = GET_THREAD();
|
rb_thread_t *th = GET_THREAD();
|
||||||
blocking_region_end(th, region);
|
blocking_region_end(th, region);
|
||||||
xfree(region);
|
xfree(region);
|
||||||
RUBY_VM_CHECK_INTS();
|
RUBY_VM_CHECK_INTS();
|
||||||
|
errno = saved_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1103,6 +1105,7 @@ rb_thread_blocking_region(
|
|||||||
{
|
{
|
||||||
VALUE val;
|
VALUE val;
|
||||||
rb_thread_t *th = GET_THREAD();
|
rb_thread_t *th = GET_THREAD();
|
||||||
|
int saved_errno = 0;
|
||||||
|
|
||||||
if (ubf == RUBY_UBF_IO || ubf == RUBY_UBF_PROCESS) {
|
if (ubf == RUBY_UBF_IO || ubf == RUBY_UBF_PROCESS) {
|
||||||
ubf = ubf_select;
|
ubf = ubf_select;
|
||||||
@ -1111,7 +1114,9 @@ rb_thread_blocking_region(
|
|||||||
|
|
||||||
BLOCKING_REGION({
|
BLOCKING_REGION({
|
||||||
val = func(data1);
|
val = func(data1);
|
||||||
|
saved_errno = errno;
|
||||||
}, ubf, data2);
|
}, ubf, data2);
|
||||||
|
errno = saved_errno;
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user