You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/09/17 21:40:21 UTC
svn commit: r816352 - in /commons/sandbox/runtime/trunk/src/main/native:
os/win32/main.c shared/sigaction.c
Author: mturk
Date: Thu Sep 17 19:40:20 2009
New Revision: 816352
URL: http://svn.apache.org/viewvc?rev=816352&view=rev
Log:
Make sure we only execute supported signals
Modified:
commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c
commons/sandbox/runtime/trunk/src/main/native/shared/sigaction.c
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c?rev=816352&r1=816351&r2=816352&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c Thu Sep 17 19:40:20 2009
@@ -419,7 +419,7 @@
acr_thread_local_t *tlsd;
tlsd = ACR_TLSD();
- if (tlsd == &null_tlsd) {
+ if (tlsd == &_null_tlsd) {
/* We cannot add to null TLSD
*/
return ACR_ENOMEM;
Modified: commons/sandbox/runtime/trunk/src/main/native/shared/sigaction.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/sigaction.c?rev=816352&r1=816351&r2=816352&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/sigaction.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/sigaction.c Thu Sep 17 19:40:20 2009
@@ -57,156 +57,189 @@
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGINT)
SIGINT,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGQUIT)
SIGQUIT,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGILL)
SIGILL,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGTRAP)
SIGTRAP,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGABRT)
SIGABRT,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGIOT)
SIGIOT,
+#elif defined(SIGABRT)
+ SIGABRT,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGBUS)
SIGBUS,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGFPE)
SIGFPE,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGKILL)
SIGKILL,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGUSR1)
SIGUSR1,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGSEGV)
SIGSEGV,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGUSR2)
SIGUSR2,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGPIPE)
SIGPIPE,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGALRM)
SIGALRM,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGTERM)
SIGTERM,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGSTKFLT)
SIGSTKFLT,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGCHLD)
SIGCHLD,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGCONT)
SIGCONT,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGSTOP)
SIGSTOP,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGTSTP)
SIGTSTP,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGTTIN)
SIGTTIN,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGTTOU)
SIGTTOU,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGURG)
SIGURG,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGXCPU)
SIGXCPU,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGXFSZ)
SIGXFSZ,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGVTALRM)
SIGVTALRM,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGPROF)
SIGPROF,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGWINCH)
SIGWINCH,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGIO)
SIGIO,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGPWR)
SIGPWR,
#else
SIG_ENOTIMPL,
#endif
+
#if defined(SIGSYS)
SIGSYS,
#else
@@ -248,9 +281,11 @@
ACR_JNI_EXPORT_DECLARE(jint, SignalAction, raise0)(ACR_JNISTDARGS, jint sig)
{
- if (_sig_translate[sig] == 0)
+ int signum = _sig_translate[sig];
+
+ if (signum == 0 || signum == SIG_ENOTIMPL)
return ACR_ENOTIMPL;
- return ACR_RaiseSignal(NULL, _sig_translate[sig], -1);
+ return ACR_RaiseSignal(NULL, signum, -1);
}
ACR_JNI_EXPORT_DECLARE(jint, SignalAction, signal0)(ACR_JNISTDARGS, jint sig,
@@ -259,7 +294,7 @@
acr_sigfunc_t *handler;
int signum = _sig_translate[sig];
- if (signum == 0)
+ if (signum == 0 || signum == SIG_ENOTIMPL)
return ACR_ENOTIMPL;
if (_callbacks[signum]) {
ACR_CallbackFree(_E, _callbacks[signum]);