aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu/java/net/natPlainSocketImplPosix.cc
diff options
context:
space:
mode:
authorDavid Daney <ddaney@avtrex.com>2007-03-23 00:06:41 +0000
committerDavid Daney <daney@gcc.gnu.org>2007-03-23 00:06:41 +0000
commit46ecc2bc5c8455615f9739847277cbc5fe746c25 (patch)
treec1ef9bb4fb3b4432ae7bce87707fc879e3e8af77 /libjava/gnu/java/net/natPlainSocketImplPosix.cc
parent92ef5cf99970d490ebdd508c774b86bd4a821887 (diff)
downloadgcc-46ecc2bc5c8455615f9739847277cbc5fe746c25.zip
gcc-46ecc2bc5c8455615f9739847277cbc5fe746c25.tar.gz
gcc-46ecc2bc5c8455615f9739847277cbc5fe746c25.tar.bz2
re PR libgcj/31228 (Race condition between setting close-on-exec and Runtime.exec())
PR libgcj/31228 * configure.ac: Add checks for getrlimit and sys/resource.h. * include/posix.h (_Jv_platform_close_on_exec): Remove. * include/config.h.in: Regenerate. * configure: Regenerate. * gnu/java/nio/channels/natFileChannelPosix.cc (open): Remove call to _Jv_platform_close_on_exec; * gnu/java/net/natPlainSocketImplPosix.cc (create): Likewise. (accept): Likewise. * gnu/java/net/natPlainDatagramSocketImplPosix.cc (create):Likewise. * java/lang/natPosixProcess.cc: Include sys/resource.h. (nativeSpawn): Close all file descriptors. Don't set FD_CLOEXEC on pipes. From-SVN: r123138
Diffstat (limited to 'libjava/gnu/java/net/natPlainSocketImplPosix.cc')
-rw-r--r--libjava/gnu/java/net/natPlainSocketImplPosix.cc4
1 files changed, 0 insertions, 4 deletions
diff --git a/libjava/gnu/java/net/natPlainSocketImplPosix.cc b/libjava/gnu/java/net/natPlainSocketImplPosix.cc
index 9fc6196..d16f1d3 100644
--- a/libjava/gnu/java/net/natPlainSocketImplPosix.cc
+++ b/libjava/gnu/java/net/natPlainSocketImplPosix.cc
@@ -72,8 +72,6 @@ gnu::java::net::PlainSocketImpl::create (jboolean stream)
throw new ::java::io::IOException (JvNewStringUTF (strerr));
}
- _Jv_platform_close_on_exec (sock);
-
// We use native_fd in place of fd here. From leaving fd null we avoid
// the double close problem in FileDescriptor.finalize.
native_fd = sock;
@@ -285,8 +283,6 @@ gnu::java::net::PlainSocketImpl::accept (gnu::java::net::PlainSocketImpl *s)
if (new_socket < 0)
goto error;
- _Jv_platform_close_on_exec (new_socket);
-
jbyteArray raddr;
jint rport;
if (u.address.sin_family == AF_INET)