1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* rubysig.h (TRAP_END): preserve errno before switching context.

[ruby-core:02137]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2004-01-02 17:46:02 +00:00
parent 59dbfa3e4c
commit 88fb246cc7
2 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Sat Jan 3 02:44:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* rubysig.h (TRAP_END): preserve errno before switching context.
[ruby-core:02137]
Sat Jan 3 01:18:08 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* dir.c: merge tuning from H.Yamamoto <ocean@m2.ccsnet.ne.jp>.

View file

@ -23,10 +23,13 @@ typedef LONG rb_atomic_t;
/* Windows doesn't allow interrupt while system calls */
# define TRAP_BEG do {\
extern int errno;\
rb_atomic_t trap_immediate = ATOMIC_SET(rb_trap_immediate, 1)
# define TRAP_END\
ATOMIC_SET(rb_trap_immediate, trap_immediate);\
CHECK_INTS;\
ATOMIC_SET(rb_trap_immediate, trap_immediate);\
saved_errno = errno;\
CHECK_INTS;\
errno = saved_errno;\
} while (0)
# define RUBY_CRITICAL(statements) do {\
rb_w32_enter_critical();\
@ -42,10 +45,14 @@ typedef int rb_atomic_t;
# define ATOMIC_DEC(var) (--(var))
# define TRAP_BEG do {\
extern int errno;\
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 {\