aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/net/natPlainSocketImpl.cc
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-03-10 17:59:23 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-03-10 17:59:23 +0000
commit0c1fcb02b154cf1840914c4b5d96a495690376e0 (patch)
tree45c63f7bfa318f36096be3612f34f51fc377a300 /libjava/java/net/natPlainSocketImpl.cc
parentb29bb8325b6d6be0353a25285fcc697b55451ab1 (diff)
downloadgcc-0c1fcb02b154cf1840914c4b5d96a495690376e0.zip
gcc-0c1fcb02b154cf1840914c4b5d96a495690376e0.tar.gz
gcc-0c1fcb02b154cf1840914c4b5d96a495690376e0.tar.bz2
Win32Process.java: Added comment.
* java/lang/Win32Process.java: Added comment. * include/posix.h (_Jv_platform_close_on_exec): New function. Include fcntl.h. * include/win32.h (_Jv_platform_close_on_exec): New function. * java/net/natPlainSocketImpl.cc (create): Set close-on-exec flag. (accept): Likewise. * java/net/natPlainDatagramSocketImpl.cc (create): Set close-on-exec flag. * java/io/natFileDescriptorPosix.cc (open): Set close-on-exec flag. From-SVN: r50536
Diffstat (limited to 'libjava/java/net/natPlainSocketImpl.cc')
-rw-r--r--libjava/java/net/natPlainSocketImpl.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/libjava/java/net/natPlainSocketImpl.cc b/libjava/java/net/natPlainSocketImpl.cc
index 99eb80b..dd8d2ccd 100644
--- a/libjava/java/net/natPlainSocketImpl.cc
+++ b/libjava/java/net/natPlainSocketImpl.cc
@@ -232,6 +232,9 @@ java::net::PlainSocketImpl::create (jboolean stream)
char* strerr = strerror (errno);
throw new java::io::IOException (JvNewStringUTF (strerr));
}
+
+ _Jv_platform_close_on_exec (sock);
+
fnum = sock;
fd = new java::io::FileDescriptor (sock);
}
@@ -374,6 +377,9 @@ java::net::PlainSocketImpl::accept (java::net::PlainSocketImpl *s)
new_socket = _Jv_accept (fnum, (sockaddr*) &u, &addrlen);
if (new_socket < 0)
goto error;
+
+ _Jv_platform_close_on_exec (new_socket);
+
jbyteArray raddr;
jint rport;
if (u.address.sin_family == AF_INET)