hotspot/src/share/vm/utilities/ostream.cpp
changeset 1889 24b003a6fe46
parent 1388 3677f5f3d66b
child 2105 347008ce7984
equal deleted inserted replaced
1888:bbf498fb4354 1889:24b003a6fe46
   298   _file = fopen(file_name, "w");
   298   _file = fopen(file_name, "w");
   299   _need_close = true;
   299   _need_close = true;
   300 }
   300 }
   301 
   301 
   302 void fileStream::write(const char* s, size_t len) {
   302 void fileStream::write(const char* s, size_t len) {
   303   if (_file != NULL)  fwrite(s, 1, len, _file);
   303   if (_file != NULL)  {
       
   304     // Make an unused local variable to avoid warning from gcc 4.x compiler.
       
   305     size_t count = fwrite(s, 1, len, _file);
       
   306   }
   304   update_position(s, len);
   307   update_position(s, len);
   305 }
   308 }
   306 
   309 
   307 fileStream::~fileStream() {
   310 fileStream::~fileStream() {
   308   if (_file != NULL) {
   311   if (_file != NULL) {
   326     _fd = -1;
   329     _fd = -1;
   327   }
   330   }
   328 }
   331 }
   329 
   332 
   330 void fdStream::write(const char* s, size_t len) {
   333 void fdStream::write(const char* s, size_t len) {
   331   if (_fd != -1) ::write(_fd, s, (int)len);
   334   if (_fd != -1) {
       
   335     // Make an unused local variable to avoid warning from gcc 4.x compiler.
       
   336     size_t count = ::write(_fd, s, (int)len);
       
   337   }
   332   update_position(s, len);
   338   update_position(s, len);
   333 }
   339 }
   334 
   340 
   335 defaultStream* defaultStream::instance = NULL;
   341 defaultStream* defaultStream::instance = NULL;
   336 int defaultStream::_output_fd = 1;
   342 int defaultStream::_output_fd = 1;