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:
parent
59dbfa3e4c
commit
88fb246cc7
2 changed files with 15 additions and 3 deletions
|
@ -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>
|
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>.
|
* dir.c: merge tuning from H.Yamamoto <ocean@m2.ccsnet.ne.jp>.
|
||||||
|
|
|
@ -23,10 +23,13 @@ typedef LONG rb_atomic_t;
|
||||||
|
|
||||||
/* Windows doesn't allow interrupt while system calls */
|
/* Windows doesn't allow interrupt while system calls */
|
||||||
# define TRAP_BEG do {\
|
# define TRAP_BEG do {\
|
||||||
|
extern int errno;\
|
||||||
rb_atomic_t trap_immediate = ATOMIC_SET(rb_trap_immediate, 1)
|
rb_atomic_t trap_immediate = ATOMIC_SET(rb_trap_immediate, 1)
|
||||||
# define TRAP_END\
|
# define TRAP_END\
|
||||||
ATOMIC_SET(rb_trap_immediate, trap_immediate);\
|
ATOMIC_SET(rb_trap_immediate, trap_immediate);\
|
||||||
|
saved_errno = errno;\
|
||||||
CHECK_INTS;\
|
CHECK_INTS;\
|
||||||
|
errno = saved_errno;\
|
||||||
} while (0)
|
} while (0)
|
||||||
# define RUBY_CRITICAL(statements) do {\
|
# define RUBY_CRITICAL(statements) do {\
|
||||||
rb_w32_enter_critical();\
|
rb_w32_enter_critical();\
|
||||||
|
@ -42,10 +45,14 @@ typedef int rb_atomic_t;
|
||||||
# define ATOMIC_DEC(var) (--(var))
|
# define ATOMIC_DEC(var) (--(var))
|
||||||
|
|
||||||
# define TRAP_BEG do {\
|
# define TRAP_BEG do {\
|
||||||
|
extern int errno;\
|
||||||
|
int saved_errno = 0;\
|
||||||
int trap_immediate = rb_trap_immediate;\
|
int trap_immediate = rb_trap_immediate;\
|
||||||
rb_trap_immediate = 1
|
rb_trap_immediate = 1
|
||||||
# define TRAP_END rb_trap_immediate = trap_immediate;\
|
# define TRAP_END rb_trap_immediate = trap_immediate;\
|
||||||
|
saved_errno = errno;\
|
||||||
CHECK_INTS;\
|
CHECK_INTS;\
|
||||||
|
errno = saved_errno;\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
# define RUBY_CRITICAL(statements) do {\
|
# define RUBY_CRITICAL(statements) do {\
|
||||||
|
|
Loading…
Reference in a new issue