comparison src/os/linux/vm/os_linux.cpp @ 8067:5cd2fac2ae70

6749267: Signal handler should save/restore errno Summary: Save errno before processing signal, then restore it. Reviewed-by: acorn, sspitsyn
author hseigel
date Tue, 19 Feb 2013 08:51:56 -0500
parents 9fae07c31641
children 4c1d8002ffb1
comparison
equal deleted inserted replaced
8066:b5e3ec9c69fa 8067:5cd2fac2ae70
3651 JVM_handle_linux_signal(int signo, siginfo_t* siginfo, 3651 JVM_handle_linux_signal(int signo, siginfo_t* siginfo,
3652 void* ucontext, int abort_if_unrecognized); 3652 void* ucontext, int abort_if_unrecognized);
3653 3653
3654 void signalHandler(int sig, siginfo_t* info, void* uc) { 3654 void signalHandler(int sig, siginfo_t* info, void* uc) {
3655 assert(info != NULL && uc != NULL, "it must be old kernel"); 3655 assert(info != NULL && uc != NULL, "it must be old kernel");
3656 int orig_errno = errno; // Preserve errno value over signal handler.
3656 JVM_handle_linux_signal(sig, info, uc, true); 3657 JVM_handle_linux_signal(sig, info, uc, true);
3658 errno = orig_errno;
3657 } 3659 }
3658 3660
3659 3661
3660 // This boolean allows users to forward their own non-matching signals 3662 // This boolean allows users to forward their own non-matching signals
3661 // to JVM_handle_linux_signal, harmlessly. 3663 // to JVM_handle_linux_signal, harmlessly.