]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[trac3706] More cpp cleanup
authorShawn Routhier <sar@isc.org>
Sat, 28 Feb 2015 01:28:00 +0000 (17:28 -0800)
committerShawn Routhier <sar@isc.org>
Sat, 28 Feb 2015 01:28:00 +0000 (17:28 -0800)
Remove another unused variable in memfile_ubench.cc

Actually use the trimmed variable in host.cc

Update commetns in process_spawn.[cc h]

src/lib/dhcpsrv/host.cc
src/lib/util/process_spawn.cc
src/lib/util/process_spawn.h
tests/tools/dhcp-ubench/memfile_ubench.cc

index 6f5a0a49269f3cbe5900935bbe3fdb2863e378b1..626ccfaa92a81edaec6988a759c2f36ffdb4eda8 100644 (file)
@@ -225,8 +225,8 @@ void
 Host::addClientClassInternal(ClientClasses& classes,
                              const std::string& class_name) {
     std::string trimmed = util::str::trim(class_name);
-    if (!class_name.empty()) {
-        classes.insert(ClientClass(class_name));
+    if (!trimmed.empty()) {
+        classes.insert(ClientClass(trimmed));
     }
 }
 
index 3f55282ed58c2ec08670720444e47c831b12b9de..e53c671f7ccf586074ca265a8afb29589b007a45 100644 (file)
@@ -31,7 +31,12 @@ namespace util {
 /// custom handling of a SIGCHLD signal, and the conversion of the
 /// arguments of the executable from the STL container to the array.
 ///
-/// Made noncopyable to avoid problems with global operations
+/// This class is made noncopyable so that we don't have attempts
+/// to make multiple copies of an object.  This avoid problems
+/// with multiple copies of objects for a single global resource
+/// such as the SIGCHLD signal handler.  In addition making it
+/// noncopyable keeps the static check codd from flagging the
+/// lack of a copy constructor as an issue.
 class ProcessSpawnImpl : boost::noncopyable {
 public:
 
index 6f726f766dd4ec3ec5ed507f4f28b4b3cd488536..976072b33fb933e8bd33caa8a63d581ef5a0f752 100644 (file)
@@ -54,7 +54,12 @@ typedef std::vector<std::string> ProcessArgs;
 /// attempt to register a new SIGCHLD signal handler and, as a
 /// consequence, the new @c ProcessSpawn object will fail to create.
 ///
-/// Made noncopyable to avoid problems with global operations
+/// This class is made noncopyable so that we don't have attempts
+/// to make multiple copies of an object.  This avoid problems
+/// with multiple copies of objects for a single global resource
+/// such as the SIGCHLD signal handler.  In addition making it
+/// noncopyable keeps the static check codd from flagging the
+/// lack of a copy constructor as an issue.
 ///
 /// @todo The SIGCHLD handling logic should be moved to the @c SignalSet
 /// class so as multiple instances of the @c ProcessSpawn use the same
index 6e92585d72180dfe728b0e4c9d19e3414483cd9b..e5f2510662d78b65c8d635956bf835360bfd8dd1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012, 2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -215,7 +215,7 @@ void memfile_uBenchmark::createLease4Test() {
     time_t cltt = time(NULL);       // Timestamp
     uint32_t pool_id = 0;           // Let's use pools 0-99
     bool fixed = false;
-    string hostname("foo");         // Will generate it dynamically
+                                    // Hostname will be generated dynamically
     bool fqdn_fwd = true;           // Let's pretend to do AAAA update
     bool fqdn_rev = true;           // Let's pretend to do PTR update