8219630: cleanup hotspot ostream.cpp
Reviewed-by: clanger, dholmes, stuefe
This commit is contained in:
parent
4295e17b28
commit
46dbe3820b
@ -559,13 +559,6 @@ void fileStream::flush() {
|
||||
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.
|
||||
|
@ -216,7 +216,6 @@ class fileStream : public outputStream {
|
||||
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 @@ CDS_ONLY(extern fileStream* classlist_file;)
|
||||
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() {};
|
||||
|
Loading…
Reference in New Issue
Block a user