diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-19 15:34:04 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-19 15:34:04 +0000 |
commit | 59b91237c339b4743620526d60e51e49ea8ed6b8 (patch) | |
tree | 02e1fc71dc3b7028e1f4ca4802de37a4ac186680 /thread.c | |
parent | 50fa45fb8933d752fbda5394d59a5cb63e810ae1 (diff) |
* 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
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1054,10 +1054,12 @@ rb_thread_blocking_region_begin(void) void rb_thread_blocking_region_end(struct rb_blocking_region_buffer *region) { + int saved_errno = errno; rb_thread_t *th = GET_THREAD(); blocking_region_end(th, region); xfree(region); RUBY_VM_CHECK_INTS(); + errno = saved_errno; } /* @@ -1103,6 +1105,7 @@ rb_thread_blocking_region( { VALUE val; rb_thread_t *th = GET_THREAD(); + int saved_errno = 0; if (ubf == RUBY_UBF_IO || ubf == RUBY_UBF_PROCESS) { ubf = ubf_select; @@ -1111,7 +1114,9 @@ rb_thread_blocking_region( BLOCKING_REGION({ val = func(data1); + saved_errno = errno; }, ubf, data2); + errno = saved_errno; return val; } |