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]
Other format: [Raw text]

Re: Patch: close-on-exec files


Adam Megacz wrote:

>Tom Tromey <tromey@redhat.com> writes:
>
>>Ok.  I've made a new _Jv_platform function which sets a file
>>descriptor to be close-on-exec.  For POSIX it calls fcntl, for Win32
>>it does nothing.
>>
>
>You forgot this.
>
>Committed to branch and trunk.
>

That patch caused the non-windows build to break because the header was 
already included as <posix.h>, and posix.h was not protected against 
multiple includes. This patch fixes both problems.

regards

Bryce.


2002-03-10  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>

        * include/posix.h: Add multiple include header protection.
        * java/net/natPlainSocketImpl.cc: Don't #include <posix.h>.

Index: java/net/natPlainSocketImpl.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/natPlainSocketImpl.cc,v
retrieving revision 1.35
diff -u -r1.35 natPlainSocketImpl.cc
--- natPlainSocketImpl.cc       2002/03/11 01:34:08     1.35
+++ natPlainSocketImpl.cc       2002/03/11 04:14:05
@@ -45,7 +45,6 @@
 #define ENOPROTOOPT 109
 #endif
 #else /* WIN32 */
-#include "posix.h"
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>

Index: include/posix.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/posix.h,v
retrieving revision 1.3.2.2
diff -u -r1.3.2.2 posix.h
--- posix.h     2002/03/10 18:00:04     1.3.2.2
+++ posix.h     2002/03/11 04:21:52
@@ -8,6 +8,9 @@
 Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
 details.  */
 
+#ifndef __JV_POSIX_H__
+#define __JV_POSIX_H__
+
 /* Required on Tru64 UNIX V4/V5 so <sys/socket.h> defines prototypes of
    socket functions with socklen_t instead of size_t.  This must be defined
    early so <standards.h> defines the correct version of __PIIX.  */
@@ -42,3 +45,5 @@
   // Ignore errors.
   fcntl (fd, F_SETFD, FD_CLOEXEC);
 }
+
+#endif



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