diff options
author | David Daney <ddaney@avtrex.com> | 2004-08-18 15:12:32 +0000 |
---|---|---|
committer | David Daney <daney@gcc.gnu.org> | 2004-08-18 15:12:32 +0000 |
commit | 720086cd84423764cfced1dc16b74821a9c3f3b1 (patch) | |
tree | 3a0c85672202098b0c107df58f4a4415569c918c /libjava/java | |
parent | 3a4416fb2a3f4781921f3633526500dccfc748c2 (diff) | |
download | gcc-720086cd84423764cfced1dc16b74821a9c3f3b1.zip gcc-720086cd84423764cfced1dc16b74821a9c3f3b1.tar.gz gcc-720086cd84423764cfced1dc16b74821a9c3f3b1.tar.bz2 |
natPosixProcess.cc (waitForSignal): Use sigsuspend instead of sigwait.
2004-08-18 David Daney <ddaney@avtrex.com>
* java/lang/natPosixProcess.cc (waitForSignal): Use sigsuspend
instead of sigwait.
From-SVN: r86186
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/lang/natPosixProcess.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libjava/java/lang/natPosixProcess.cc b/libjava/java/lang/natPosixProcess.cc index f6b6f67..a4b87c3 100644 --- a/libjava/java/lang/natPosixProcess.cc +++ b/libjava/java/lang/natPosixProcess.cc @@ -130,20 +130,22 @@ java::lang::ConcreteProcess$ProcessManager::waitForSignal () sigset_t mask; // Wait for SIGCHLD - sigemptyset (&mask); - sigaddset (&mask, SIGCHLD); + pthread_sigmask (0, NULL, &mask); + sigdelset (&mask, SIGCHLD); + // Use sigsuspend() instead of sigwait() as sigwait() doesn't play + // nicely with the GC's use of signals. + int c = sigsuspend (&mask); - int sig; - int c = sigwait (&mask, &sig); - - if (c != 0) + if (c != -1) + goto error; + if (errno != EINTR) goto error; // All OK. return; error: - throw new InternalError (JvNewStringUTF (strerror (c))); + throw new InternalError (JvNewStringUTF (strerror (errno))); } jboolean java::lang::ConcreteProcess$ProcessManager::reap () |