8219630: cleanup hotspot ostream.cpp
authormbaesken
Tue, 26 Feb 2019 09:57:11 +0100
changeset 53931 f47ca94f30b9
parent 53930 df3d253aaf81
child 53932 33839b74e47c
child 53939 7f715085caac
8219630: cleanup hotspot ostream.cpp Reviewed-by: clanger, dholmes, stuefe
src/hotspot/share/utilities/ostream.cpp
src/hotspot/share/utilities/ostream.hpp
--- a/src/hotspot/share/utilities/ostream.cpp	Wed Feb 27 02:49:52 2019 +0000
+++ b/src/hotspot/share/utilities/ostream.cpp	Tue Feb 26 09:57:11 2019 +0100
@@ -559,13 +559,6 @@
   fflush(_file);
 }
 
-fdStream::~fdStream() {
-  if (_fd != -1) {
-    if (_need_close) close(_fd);
-    _fd = -1;
-  }
-}
-
 void fdStream::write(const char* s, size_t len) {
   if (_fd != -1) {
     // Make an unused local variable to avoid warning from gcc 4.x compiler.
--- a/src/hotspot/share/utilities/ostream.hpp	Wed Feb 27 02:49:52 2019 +0000
+++ b/src/hotspot/share/utilities/ostream.hpp	Tue Feb 26 09:57:11 2019 +0100
@@ -216,7 +216,6 @@
   fileStream(FILE* file, bool need_close = false) { _file = file; _need_close = need_close; }
   ~fileStream();
   bool is_open() const { return _file != NULL; }
-  void set_need_close(bool b) { _need_close = b;}
   virtual void write(const char* c, size_t len);
   size_t read(void *data, size_t size, size_t count) { return ::fread(data, size, count, _file); }
   char* readln(char *data, int count);
@@ -235,13 +234,10 @@
 class fdStream : public outputStream {
  protected:
   int  _fd;
-  bool _need_close;
  public:
-  fdStream(const char* file_name);
-  fdStream(int fd = -1) { _fd = fd; _need_close = false; }
-  ~fdStream();
+  fdStream(int fd = -1) : _fd(fd) { }
   bool is_open() const { return _fd != -1; }
-  void set_fd(int fd) { _fd = fd; _need_close = false; }
+  void set_fd(int fd) { _fd = fd; }
   int fd() const { return _fd; }
   virtual void write(const char* c, size_t len);
   void flush() {};