From: David Daney Date: Wed, 18 Aug 2004 15:12:32 +0000 (+0000) Subject: natPosixProcess.cc (waitForSignal): Use sigsuspend instead of sigwait. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=720086cd84423764cfced1dc16b74821a9c3f3b1;p=gcc.git natPosixProcess.cc (waitForSignal): Use sigsuspend instead of sigwait. 2004-08-18 David Daney * java/lang/natPosixProcess.cc (waitForSignal): Use sigsuspend instead of sigwait. From-SVN: r86186 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index a5de0d47a80..0fa156d48d5 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2004-08-18 David Daney + + * java/lang/natPosixProcess.cc (waitForSignal): Use sigsuspend + instead of sigwait. + 2004-08-17 Michael Koch * Makefile.am (AM_CXXFLAGS): Reformatted to make it more ease to read. diff --git a/libjava/java/lang/natPosixProcess.cc b/libjava/java/lang/natPosixProcess.cc index f6b6f67baf5..a4b87c3a300 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 ()