This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Patch: SIGPIPE and DISABLE_JAVA_NET


Jeff wrote:
> I'm confused.  I thought the SIGPIPE handler exists for
> java.lang.Process, not java.net... what's the connection?  Surely someone
> may want one and not the other.

Is this better?  Could somebody explain how the sigaction code is different
from my simple `signal' call?  I'm pretty clueless about signal handling.

Thanks!

AG


2001-05-23  Anthony Green  <green@redhat.com>

        * configure.in: Test for sigaction on native builds.
        * prims.cc: Check HAVE_SIGACTION.
        * include/config.h.in: Rebuilt.

Index: configure.in
===================================================================
RCS file: /cvs/cvsfiles/devo/libjava/configure.in,v
retrieving revision 1.85
diff -u -p -p -r1.85 configure.in
--- configure.in        2001/05/15 01:31:32     1.85
+++ configure.in        2001/05/24 00:53:44
@@ -389,7 +399,7 @@ else
    AC_CHECK_FUNCS(iconv nl_langinfo setlocale)
    AC_CHECK_FUNCS(inet_aton inet_addr, break)
    AC_CHECK_FUNCS(inet_pton uname inet_ntoa)
-   AC_CHECK_FUNCS(backtrace fork execvp pipe)
+   AC_CHECK_FUNCS(backtrace fork execvp pipe sigaction)
    AC_CHECK_HEADERS(execinfo.h unistd.h dlfcn.h)
    AC_CHECK_LIB(dl, dladdr, [
      AC_DEFINE(HAVE_DLADDR)])
Index: prims.cc
===================================================================
RCS file: /cvs/cvsfiles/devo/libjava/prims.cc,v
retrieving revision 1.83
diff -u -p -p -r1.83 prims.cc
--- prims.cc    2001/04/30 22:38:25     1.83
+++ prims.cc    2001/05/24 00:53:44
@@ -673,14 +673,16 @@ main_init ()
 #ifdef USE_WIN32_SIGNALLING
   // Install exception handler
   SetUnhandledExceptionFilter (win32_exception_handler);
-#else
+#elif defined(HAVE_SIGACTION)
   // We only want this on POSIX systems.
   struct sigaction act;
   act.sa_handler = SIG_IGN;
   sigemptyset (&act.sa_mask);
   act.sa_flags = 0;
   sigaction (SIGPIPE, &act, NULL);
-#endif /* USE_WIN32_SIGNALLING */
+#else
+  signal (SIGPIPE, SIG_IGN);
+#endif

   _Jv_JNI_Init ();
 }
Index: include/config.h.in
===================================================================
RCS file: /cvs/cvsfiles/devo/libjava/include/config.h.in,v
retrieving revision 1.35
diff -u -p -p -r1.35 config.h.in
--- config.h.in 2001/04/30 22:38:26     1.35
+++ config.h.in 2001/05/24 00:53:44
@@ -268,6 +271,9 @@
 /* Define if you have the setlocale function.  */
 #undef HAVE_SETLOCALE
+
+/* Define if you have the sigaction function.  */
+#undef HAVE_SIGACTION

 /* Define if you have the sleep function.  */
 #undef HAVE_SLEEP


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]