mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8267666: Add option to jcmd GC.heap_dump to use existing file
Reviewed-by: rschmelter, clanger
This commit is contained in:
parent
8973867fb9
commit
7cbb67a3f8
11 changed files with 27 additions and 23 deletions
|
@ -4963,9 +4963,7 @@ int os::open(const char *path, int oflag, int mode) {
|
|||
// create binary file, rewriting existing file if required
|
||||
int os::create_binary_file(const char* path, bool rewrite_existing) {
|
||||
int oflags = O_WRONLY | O_CREAT;
|
||||
if (!rewrite_existing) {
|
||||
oflags |= O_EXCL;
|
||||
}
|
||||
oflags |= rewrite_existing ? O_TRUNC : O_EXCL;
|
||||
return ::open64(path, oflags, S_IREAD | S_IWRITE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue