comparison src/os/bsd/vm/os_bsd.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 758935f7c23f
children 5fc51c1ecdeb 63e54c37ac64 bf06968a8a00
comparison
equal deleted inserted replaced
8066:b5e3ec9c69fa 8067:5cd2fac2ae70
2885 JVM_handle_bsd_signal(int signo, siginfo_t* siginfo, 2885 JVM_handle_bsd_signal(int signo, siginfo_t* siginfo,
2886 void* ucontext, int abort_if_unrecognized); 2886 void* ucontext, int abort_if_unrecognized);
2887 2887
2888 void signalHandler(int sig, siginfo_t* info, void* uc) { 2888 void signalHandler(int sig, siginfo_t* info, void* uc) {
2889 assert(info != NULL && uc != NULL, "it must be old kernel"); 2889 assert(info != NULL && uc != NULL, "it must be old kernel");
2890 int orig_errno = errno; // Preserve errno value over signal handler.
2890 JVM_handle_bsd_signal(sig, info, uc, true); 2891 JVM_handle_bsd_signal(sig, info, uc, true);
2892 errno = orig_errno;
2891 } 2893 }
2892 2894
2893 2895
2894 // This boolean allows users to forward their own non-matching signals 2896 // This boolean allows users to forward their own non-matching signals
2895 // to JVM_handle_bsd_signal, harmlessly. 2897 // to JVM_handle_bsd_signal, harmlessly.