equal
deleted
inserted
replaced
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; |