8194734: Handle to jimage file inherited into child processes (win)

Reviewed-by: alanb
This commit is contained in:
Aleandr Miloslavskiy 2018-04-16 09:36:01 +01:00 committed by Alan Bateman
parent 45fb75c85a
commit d574c9e091

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -38,7 +38,8 @@
* Return the file descriptor.
*/
jint osSupport::openReadOnly(const char *path) {
return ::open(path, 0, 0);
// jimage file descriptors must not be inherited by child processes
return ::open(path, O_BINARY | O_NOINHERIT, O_RDONLY);
}
/**