summaryrefslogtreecommitdiff
path: root/rubysig.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-06 08:19:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-06 08:19:20 +0000
commit004127aa904cec52e80bbfc756c4a18b7f4970f0 (patch)
treeea2be7d7636dfbfa75cea78cb7248331e15ba78b /rubysig.h
parenta4a18e67e0970d1edde4b5b5535be561b92dd730 (diff)
* rubysig.h (TRAP_BEG, TRAP_END): safe errno around CHECK_INTS.
(backported from CVS HEAD) [ruby-dev:24993] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rubysig.h')
-rw-r--r--rubysig.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/rubysig.h b/rubysig.h
index 8871e3a..fd43e85 100644
--- a/rubysig.h
+++ b/rubysig.h
@@ -46,10 +46,13 @@ typedef int rb_atomic_t;
# define ATOMIC_DEC(var) (--(var))
# define TRAP_BEG do {\
+ int saved_errno = 0;\
int trap_immediate = rb_trap_immediate;\
rb_trap_immediate = 1
# define TRAP_END rb_trap_immediate = trap_immediate;\
- CHECK_INTS;\
+ saved_errno = errno;\
+ CHECK_INTS;\
+ errno = saved_errno;\
} while (0)
# define RUBY_CRITICAL(statements) do {\