BIND 10 trac1704, updated. 4507aa61c9e802dadb0293a51e5f92760f916764 [1704] editorial fixes: braces; long lines; NULL vs false; const

BIND 10 source code commits bind10-changes at lists.isc.org
Fri May 18 01:38:49 UTC 2012


The branch, trac1704 has been updated
       via  4507aa61c9e802dadb0293a51e5f92760f916764 (commit)
      from  c7a947916fee9b583a94aff12e8f2d0ee5652b81 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4507aa61c9e802dadb0293a51e5f92760f916764
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu May 17 18:36:38 2012 -0700

    [1704] editorial fixes: braces; long lines; NULL vs false; const

-----------------------------------------------------------------------

Summary of changes:
 src/lib/log/logger.cc |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/log/logger.cc b/src/lib/log/logger.cc
index 7ce5976..cc158eb 100644
--- a/src/lib/log/logger.cc
+++ b/src/lib/log/logger.cc
@@ -46,13 +46,15 @@ Logger::Logger(const char* name) : loggerptr_(NULL) {
 
     lockfile_path_ = LOCKFILE_DIR;
 
-    const char *env = getenv("B10_FROM_SOURCE");
-    if (env)
+    const char* const env = getenv("B10_FROM_SOURCE");
+    if (env != NULL) {
         lockfile_path_ = env;
+    }
 
-    const char *env2 = getenv("B10_FROM_SOURCE_LOCALSTATEDIR");
-    if (env2)
+    const char* const env2 = getenv("B10_FROM_SOURCE_LOCALSTATEDIR");
+    if (env2 != NULL) {
         lockfile_path_ = env2;
+    }
 
     lockfile_path_ += "/logger_lockfile";
 
@@ -74,8 +76,9 @@ void Logger::initLoggerImpl() {
 // Destructor.
 
 Logger::~Logger() {
-    if (lock_fd_ != -1)
+    if (lock_fd_ != -1) {
         close(lock_fd_);
+    }
     // The lockfile will continue to exist, as we mustn't delete it.
 
     delete loggerptr_;
@@ -169,7 +172,9 @@ Logger::output(const Severity& severity, const std::string& message) {
     int status;
 
     if (lock_fd_ == -1) {
-        getLoggerPtr()->outputRaw(isc::log::WARN, "Unable to use logger lockfile: " + lockfile_path_);
+        getLoggerPtr()->outputRaw(isc::log::WARN,
+                                  "Unable to use logger lockfile: " +
+                                  lockfile_path_);
     } else {
         memset(&lock, 0, sizeof lock);
         lock.l_type = F_WRLCK;
@@ -178,7 +183,9 @@ Logger::output(const Severity& severity, const std::string& message) {
         lock.l_len = 1;
         status = fcntl(lock_fd_, F_SETLKW, &lock);
         if (status != 0) {
-            getLoggerPtr()->outputRaw(isc::log::WARN, "Unable to lock logger lockfile: " + lockfile_path_);
+            getLoggerPtr()->outputRaw(isc::log::WARN,
+                                      "Unable to lock logger lockfile: " +
+                                      lockfile_path_);
             return;
         }
 
@@ -193,7 +200,9 @@ Logger::output(const Severity& severity, const std::string& message) {
         lock.l_len = 1;
         status = fcntl(lock_fd_, F_SETLKW, &lock);
         if (status != 0) {
-            getLoggerPtr()->outputRaw(isc::log::WARN, "Unable to unlock logger lockfile: " + lockfile_path_);
+            getLoggerPtr()->outputRaw(isc::log::WARN,
+                                      "Unable to unlock logger lockfile: " +
+                                      lockfile_path_);
         }
     }
 }



More information about the bind10-changes mailing list