src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.cpp
changeset 54263 3cabb47758c9
parent 53897 0abec72a3ac2
child 57360 5d043a159d5c
child 58132 caa25ab47aca
--- a/src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.cpp	Mon Mar 25 14:11:09 2019 +0100
+++ b/src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.cpp	Mon Mar 25 15:37:06 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, 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
@@ -46,13 +46,9 @@
   return _chunkstate != NULL;
 }
 
-static fio_fd open_existing(const char* path) {
-  return os::open(path, O_RDWR, S_IREAD | S_IWRITE);
-}
-
 static fio_fd open_chunk(const char* path) {
   assert(JfrStream_lock->owned_by_self(), "invariant");
-  return path != NULL ? open_existing(path) : invalid_fd;
+  return path != NULL ? os::open(path, O_CREAT | O_RDWR, S_IREAD | S_IWRITE) : invalid_fd;
 }
 
 bool JfrChunkWriter::open() {