From: Colin Patrick McCabe Date: Wed, 1 Jun 2011 18:52:31 +0000 (-0700) Subject: dout:remove stream from dout_emerg_streams earlier X-Git-Tag: v0.30~128 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=90b53543ea682f216d62fb88ed20971361b7cb9a;p=ceph.git dout:remove stream from dout_emerg_streams earlier Signed-off-by: Colin McCabe --- 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.