comparison src/share/vm/utilities/vmError.cpp @ 21818:5ca2ea5eeff0

Merge
author asaha
date Fri, 31 Oct 2014 17:09:14 -0700
parents 833b0f92429a 60a992c821f8
children b1cf34d57e78
comparison
equal deleted inserted replaced
21817:12478c5eb000 21818:5ca2ea5eeff0
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"
839 840
840 /** Expand a pattern into a buffer starting at pos and open a file using constructed path */ 841 /** Expand a pattern into a buffer starting at pos and open a file using constructed path */
841 static int expand_and_open(const char* pattern, char* buf, size_t buflen, size_t pos) { 842 static int expand_and_open(const char* pattern, char* buf, size_t buflen, size_t pos) {
842 int fd = -1; 843 int fd = -1;
843 if (Arguments::copy_expand_pid(pattern, strlen(pattern), &buf[pos], buflen - pos)) { 844 if (Arguments::copy_expand_pid(pattern, strlen(pattern), &buf[pos], buflen - pos)) {
844 fd = open(buf, O_RDWR | O_CREAT | O_TRUNC, 0666); 845 // the O_EXCL flag will cause the open to fail if the file exists
846 fd = open(buf, O_RDWR | O_CREAT | O_EXCL, 0666);
845 } 847 }
846 return fd; 848 return fd;
847 } 849 }
848 850
849 /** 851 /**