summaryrefslogtreecommitdiff
path: root/libjava/java/lang
diff options
context:
space:
mode:
authordoko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-15 08:19:32 +0000
committerdoko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-15 08:19:32 +0000
commitd1e7f33afc1565bc4c0e28ef52276ef264a92140 (patch)
tree20a95dba98a781f9019205092cc3ff00c42cc30d /libjava/java/lang
parent534b7773bfd3cbf90cc1d4431dc03897aac2993f (diff)
downloadgcc-d1e7f33afc1565bc4c0e28ef52276ef264a92140.tar.gz
2007-08-15 Samuel Thibault <samuel.thibault@ens-lyon.org>
* java/lang/natPosixProcess.cc (sigchld_handler) [!SA_SIGINFO]: Remove 'si' and 'third' parameters. Disable calling pmi->old_sigaction.sa_sigaction. (java::lang::PosixProcess*ProcessManager::init) [!SA_SIGINFO]: Set sa.sa_handler instead of sa.sa_sigaction, don't set SA_SIGINFO flag. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127507 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/lang')
-rw-r--r--libjava/java/lang/natPosixProcess.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/libjava/java/lang/natPosixProcess.cc b/libjava/java/lang/natPosixProcess.cc
index eadc44f8403..fbd3f6a0a1b 100644
--- a/libjava/java/lang/natPosixProcess.cc
+++ b/libjava/java/lang/natPosixProcess.cc
@@ -110,7 +110,11 @@ namespace
// sigwait() on SIGCHLD. The information passed is ignored as it
// will be recovered by the waitpid() call.
static void
+#ifdef SA_SIGINFO
sigchld_handler (int sig, siginfo_t *si, void *third)
+#else
+sigchld_handler (int sig)
+#endif
{
if (PosixProcess$ProcessManager::nativeData != NULL)
{
@@ -121,9 +125,11 @@ sigchld_handler (int sig, siginfo_t *si, void *third)
if (pmi->old_sigaction.sa_handler != SIG_DFL
&& pmi->old_sigaction.sa_handler != SIG_IGN)
{
+#ifdef SA_SIGINFO
if ((pmi->old_sigaction.sa_flags & SA_SIGINFO) != 0)
pmi->old_sigaction.sa_sigaction(sig, si, third);
else
+#endif
(*pmi->old_sigaction.sa_handler)(sig);
}
}
@@ -156,9 +162,15 @@ java::lang::PosixProcess$ProcessManager::init ()
struct sigaction sa;
memset (&sa, 0, sizeof (sa));
+#ifdef SA_SIGINFO
sa.sa_sigaction = sigchld_handler;
// We only want signals when the things exit.
sa.sa_flags = SA_NOCLDSTOP | SA_SIGINFO;
+#else
+ sa.sa_handler = sigchld_handler;
+ // We only want signals when the things exit.
+ sa.sa_flags = SA_NOCLDSTOP;
+#endif
if (-1 == sigaction (SIGCHLD, &sa, &pmi->old_sigaction))
goto error;