From 90b53543ea682f216d62fb88ed20971361b7cb9a Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Wed, 1 Jun 2011 11:52:31 -0700 Subject: [PATCH] dout:remove stream from dout_emerg_streams earlier Signed-off-by: Colin McCabe --- src/common/DoutStreambuf.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/DoutStreambuf.cc b/src/common/DoutStreambuf.cc index 5aec02b8b7a2d..b5612476bd2d7 100644 --- a/src/common/DoutStreambuf.cc +++ b/src/common/DoutStreambuf.cc @@ -184,11 +184,6 @@ DoutStreambuf::DoutStreambuf() template DoutStreambuf::~DoutStreambuf() { - if (ofd != -1) { - TEMP_FAILURE_RETRY(::close(ofd)); - ofd = -1; - } - pthread_mutex_destroy(&lock); simple_spin_lock(&dout_emergency_lock); for (size_t i = 0; i < NUM_DOUT_EMERG_STREAMS; ++i) { if (dout_emerg_streams[i] == this) { @@ -197,6 +192,11 @@ DoutStreambuf::~DoutStreambuf() } } simple_spin_unlock(&dout_emergency_lock); + if (ofd != -1) { + TEMP_FAILURE_RETRY(::close(ofd)); + ofd = -1; + } + pthread_mutex_destroy(&lock); } // This function is called when the output buffer is filled. -- 2.39.5