# HG changeset patch # User mbaesken # Date 1551171431 -3600 # Node ID f47ca94f30b9cc82b564fc93c42aa92216ae5c75 # Parent df3d253aaf81afabd454cdbb1689f60493f83407 8219630: cleanup hotspot ostream.cpp Reviewed-by: clanger, dholmes, stuefe diff -r df3d253aaf81 -r f47ca94f30b9 src/hotspot/share/utilities/ostream.cpp --- 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. diff -r df3d253aaf81 -r f47ca94f30b9 src/hotspot/share/utilities/ostream.hpp --- 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() {};