aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/io/natFileDescriptorWin32.cc
diff options
context:
space:
mode:
authorMohan Embar <gnustuff@thisiscool.com>2003-11-07 03:13:56 +0000
committerMohan Embar <membar@gcc.gnu.org>2003-11-07 03:13:56 +0000
commitbbf76ec06cbb846464bbb3701280167d0319b47b (patch)
treec9570d50348a6ac911e60fd0d891fb96bfe37fcc /libjava/java/io/natFileDescriptorWin32.cc
parenteb4ad71ac1d151524c097e7f956d44b3b7eafd52 (diff)
downloadgcc-bbf76ec06cbb846464bbb3701280167d0319b47b.zip
gcc-bbf76ec06cbb846464bbb3701280167d0319b47b.tar.gz
gcc-bbf76ec06cbb846464bbb3701280167d0319b47b.tar.bz2
win32.h (_Jv_platform_close_on_exec): Changed signature and declared extern.
* include/win32.h (_Jv_platform_close_on_exec): Changed signature and declared extern. * win32.cc (_Jv_platform_close_on_exec): Implemented. * gnu/java/net/natPlainDatagramSocketImplWin32.cc (create): Use new signature of _Jv_platform_close_on_exec. * gnu/java/net/natPlainSocketImplWin32.cc (create): Eliminated a few typecasts Use new signature of _Jv_platform_close_on_exec. (accept): Eliminated a few typecasts Use new signature of _Jv_platform_close_on_exec. * java/io/natFileDescriptorWin32.cc (open): Use _Jv_platform_close_on_exec. From-SVN: r73325
Diffstat (limited to 'libjava/java/io/natFileDescriptorWin32.cc')
-rw-r--r--libjava/java/io/natFileDescriptorWin32.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/libjava/java/io/natFileDescriptorWin32.cc b/libjava/java/io/natFileDescriptorWin32.cc
index 1891bf7..465d755 100644
--- a/libjava/java/io/natFileDescriptorWin32.cc
+++ b/libjava/java/io/natFileDescriptorWin32.cc
@@ -133,7 +133,13 @@ java::io::FileDescriptor::open (jstring path, jint jflags) {
throw new FileNotFoundException (_Jv_WinStrError (cpath, dwErrorCode));
}
}
- return (jint)handle;
+
+ // Make this handle non-inheritable so that child
+ // processes don't inadvertently prevent us from
+ // closing this file.
+ _Jv_platform_close_on_exec (handle);
+
+ return (jint) handle;
}
void