From 58250f59c663099ab8b55d3fde6fb3f296b1aefa Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 3 Mar 2016 09:41:45 -0500 Subject: [PATCH] log: fix some whitespace Signed-off-by: Sage Weil --- src/log/Log.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/log/Log.cc b/src/log/Log.cc index 982510949977..24d83b6015ca 100644 --- a/src/log/Log.cc +++ b/src/log/Log.cc @@ -281,9 +281,10 @@ void Log::_flush(EntryQueue *t, EntryQueue *requeue, bool crash) char *buf; size_t buf_size = 80 + e->size(); - bool need_dynamic = buf_size >= 0x10000; //avoids >64K buffers allocation at stack + bool need_dynamic = buf_size >= 0x10000; //avoids >64K buffers + //allocation at stack char buf0[need_dynamic ? 1 : buf_size]; - if(need_dynamic) { + if (need_dynamic) { buf = new char[buf_size]; } else { buf = buf0; @@ -296,7 +297,8 @@ void Log::_flush(EntryQueue *t, EntryQueue *requeue, bool crash) (unsigned long)e->m_thread, e->m_prio); buflen += e->snprintf(buf + buflen, buf_size - buflen - 1); - if (buflen > buf_size - 1) { //paranoid check, buf was declared to hold everything + if (buflen > buf_size - 1) { //paranoid check, buf was declared + //to hold everything buflen = buf_size - 1; buf[buflen] = 0; } @@ -312,9 +314,10 @@ void Log::_flush(EntryQueue *t, EntryQueue *requeue, bool crash) buf[buflen] = '\n'; int r = safe_write(m_fd, buf, buflen+1); if (r < 0) - cerr << "problem writing to " << m_log_file << ": " << cpp_strerror(r) << std::endl; + cerr << "problem writing to " << m_log_file << ": " << cpp_strerror(r) + << std::endl; } - if(need_dynamic) + if (need_dynamic) delete[] buf; } if (do_graylog2 && m_graylog) { -- 2.47.3