comparison src/share/vm/utilities/vmError.cpp @ 21816:60a992c821f8

8050807: Better performing performance data handling Reviewed-by: dcubed, dholmes, pnauman, ctornqvi, mschoene Contributed-by: gerald.thornbrugh@oracle.com
author hseigel
date Fri, 24 Oct 2014 15:02:37 -0400
parents f73af4455d7d
children 42f27b59c550 5ca2ea5eeff0
comparison
equal deleted inserted replaced
21815:37179dcf830a 21816:60a992c821f8
20 * or visit www.oracle.com if you need additional information or have any 20 * or visit www.oracle.com if you need additional information or have any
21 * questions. 21 * questions.
22 * 22 *
23 */ 23 */
24 24
25 #include <fcntl.h>
25 #include "precompiled.hpp" 26 #include "precompiled.hpp"
26 #include "compiler/compileBroker.hpp" 27 #include "compiler/compileBroker.hpp"
27 #include "gc_interface/collectedHeap.hpp" 28 #include "gc_interface/collectedHeap.hpp"
28 #include "prims/whitebox.hpp" 29 #include "prims/whitebox.hpp"
29 #include "runtime/arguments.hpp" 30 #include "runtime/arguments.hpp"
834 835
835 /** Expand a pattern into a buffer starting at pos and open a file using constructed path */ 836 /** Expand a pattern into a buffer starting at pos and open a file using constructed path */
836 static int expand_and_open(const char* pattern, char* buf, size_t buflen, size_t pos) { 837 static int expand_and_open(const char* pattern, char* buf, size_t buflen, size_t pos) {
837 int fd = -1; 838 int fd = -1;
838 if (Arguments::copy_expand_pid(pattern, strlen(pattern), &buf[pos], buflen - pos)) { 839 if (Arguments::copy_expand_pid(pattern, strlen(pattern), &buf[pos], buflen - pos)) {
839 fd = open(buf, O_RDWR | O_CREAT | O_TRUNC, 0666); 840 // the O_EXCL flag will cause the open to fail if the file exists
841 fd = open(buf, O_RDWR | O_CREAT | O_EXCL, 0666);
840 } 842 }
841 return fd; 843 return fd;
842 } 844 }
843 845
844 /** 846 /**