diff options
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/io/natFileDescriptorWin32.cc | 8 |
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 |