From: Shawn Routhier Date: Sat, 28 Feb 2015 01:28:00 +0000 (-0800) Subject: [trac3706] More cpp cleanup X-Git-Tag: trac3745_base~5^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ff0f2e2ad36bcbced4ee88f9d56aaad553c1ac82;p=thirdparty%2Fkea.git [trac3706] More cpp cleanup Remove another unused variable in memfile_ubench.cc Actually use the trimmed variable in host.cc Update commetns in process_spawn.[cc h] --- diff --git a/src/lib/dhcpsrv/host.cc b/src/lib/dhcpsrv/host.cc index 6f5a0a4926..626ccfaa92 100644 --- a/src/lib/dhcpsrv/host.cc +++ b/src/lib/dhcpsrv/host.cc @@ -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)); } } diff --git a/src/lib/util/process_spawn.cc b/src/lib/util/process_spawn.cc index 3f55282ed5..e53c671f7c 100644 --- a/src/lib/util/process_spawn.cc +++ b/src/lib/util/process_spawn.cc @@ -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: diff --git a/src/lib/util/process_spawn.h b/src/lib/util/process_spawn.h index 6f726f766d..976072b33f 100644 --- a/src/lib/util/process_spawn.h +++ b/src/lib/util/process_spawn.h @@ -54,7 +54,12 @@ typedef std::vector 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 diff --git a/tests/tools/dhcp-ubench/memfile_ubench.cc b/tests/tools/dhcp-ubench/memfile_ubench.cc index 6e92585d72..e5f2510662 100644 --- a/tests/tools/dhcp-ubench/memfile_ubench.cc +++ b/tests/tools/dhcp-ubench/memfile_ubench.cc @@ -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