ruby-changes:15500
From: mame <ko1@a...>
Date: Tue, 20 Apr 2010 00:34:21 +0900 (JST)
Subject: [ruby-changes:15500] Ruby:r27401 (trunk): * thread.c (rb_thread_blocking_region, rb_thread_blocking_region_end):
mame 2010-04-20 00:34:04 +0900 (Tue, 20 Apr 2010) New Revision: 27401 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27401 Log: * thread.c (rb_thread_blocking_region, rb_thread_blocking_region_end): preserve errno. [Bug #2606] [ruby-core:28924] Modified files: trunk/ChangeLog trunk/thread.c Index: ChangeLog =================================================================== --- ChangeLog (revision 27400) +++ ChangeLog (revision 27401) @@ -1,3 +1,8 @@ +Mon Apr 19 23:14:45 2010 Yusuke Endoh <mame@t...> + + * 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@r...> * lib/fileutils.rb (FileUtils::cp_r): backport r11156 from ruby_1_8. Index: thread.c =================================================================== --- thread.c (revision 27400) +++ thread.c (revision 27401) @@ -1054,10 +1054,12 @@ 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 @@ { 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 @@ BLOCKING_REGION({ val = func(data1); + saved_errno = errno; }, ubf, data2); + errno = saved_errno; return val; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/