提交 a8e99603 编写于 作者: H hseigel

6749267: Signal handler should save/restore errno

Summary: Save errno before processing signal, then restore it.
Reviewed-by: acorn, sspitsyn
上级 75b98722
......@@ -2887,7 +2887,9 @@ JVM_handle_bsd_signal(int signo, siginfo_t* siginfo,
void signalHandler(int sig, siginfo_t* info, void* uc) {
assert(info != NULL && uc != NULL, "it must be old kernel");
int orig_errno = errno; // Preserve errno value over signal handler.
JVM_handle_bsd_signal(sig, info, uc, true);
errno = orig_errno;
}
......
......@@ -3653,7 +3653,9 @@ JVM_handle_linux_signal(int signo, siginfo_t* siginfo,
void signalHandler(int sig, siginfo_t* info, void* uc) {
assert(info != NULL && uc != NULL, "it must be old kernel");
int orig_errno = errno; // Preserve errno value over signal handler.
JVM_handle_linux_signal(sig, info, uc, true);
errno = orig_errno;
}
......
......@@ -4317,7 +4317,9 @@ JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext,
void signalHandler(int sig, siginfo_t* info, void* ucVoid) {
int orig_errno = errno; // Preserve errno value over signal handler.
JVM_handle_solaris_signal(sig, info, ucVoid, true);
errno = orig_errno;
}
/* Do not delete - if guarantee is ever removed, a signal handler (even empty)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册