< prev index next >
src/hotspot/share/utilities/ostream.cpp
Print this page
rev 58767 : 8242485: Null _file checking in fileStream::flush()
*** 549,558 ****
--- 549,559 ----
}
return size;
}
char* fileStream::readln(char *data, int count ) {
+ assert(_file != NULL, "sanity check");
char * ret = ::fgets(data, count, _file);
//Get rid of annoying \n char
data[::strlen(data)-1] = '\0';
return ret;
}
*** 563,573 ****
--- 564,576 ----
_file = NULL;
}
}
void fileStream::flush() {
+ if (_file != NULL) {
fflush(_file);
+ }
}
void fdStream::write(const char* s, size_t len) {
if (_fd != -1) {
// Make an unused local variable to avoid warning from gcc compiler.
< prev index next >