diff -r dd00ce8e80fc -r d7b6bdd51abe src/share/vm/utilities/vmError.cpp --- a/src/share/vm/utilities/vmError.cpp Mon Nov 24 09:18:13 2014 -0800 +++ b/src/share/vm/utilities/vmError.cpp Mon Nov 17 15:51:46 2014 -0500 @@ -22,6 +22,7 @@ * */ +#include #include "precompiled.hpp" #include "compiler/compileBroker.hpp" #include "gc_interface/collectedHeap.hpp" @@ -836,7 +837,8 @@ static int expand_and_open(const char* pattern, char* buf, size_t buflen, size_t pos) { int fd = -1; if (Arguments::copy_expand_pid(pattern, strlen(pattern), &buf[pos], buflen - pos)) { - fd = open(buf, O_RDWR | O_CREAT | O_TRUNC, 0666); + // the O_EXCL flag will cause the open to fail if the file exists + fd = open(buf, O_RDWR | O_CREAT | O_EXCL, 0666); } return fd; }