Commit 14a6ed7d authored by Shawn Routhier's avatar Shawn Routhier
Browse files

Merge branch 'trac3706' Tidy up some issues find by cpp check

parents 495a29ab c9741c51
......@@ -313,7 +313,10 @@ Pkt6::unpackMsg(OptionBuffer::const_iterator begin,
((*begin++) << 8) + (*begin++);
transid_ = transid_ & 0xffffff;
size -= sizeof(uint32_t); // We just parsed 4 bytes header
// See below about invoking Postel's law, as we aren't using
// size we don't need to update it. If we do so in the future
// perhaps for stats gathering we can uncomment this.
// size -= sizeof(uint32_t); // We just parsed 4 bytes header
OptionBuffer opt_buffer(begin, end);
......
......@@ -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));
}
}
......
......@@ -806,8 +806,7 @@ Memfile_LeaseMgr::lfcSetup() {
template<typename LeaseFileType>
void Memfile_LeaseMgr::lfcExecute(boost::shared_ptr<LeaseFileType>& lease_file) {
bool do_lfc = true;
// This string will hold a reason for the failure to rote the lease files.
std::string error_string = "(no details)";
// Check if the copy of the lease file exists already. If it does, it
// is an indication that another LFC instance may be in progress or
// may be stalled. In that case we don't want to rotate the current
......
......@@ -155,7 +155,6 @@ public:
++i) {
Memfile_LeaseMgr::LFCFileType type = static_cast<
Memfile_LeaseMgr::LFCFileType>(i);
std::string suffix = Memfile_LeaseMgr::appendSuffix(base_name, type);
LeaseFileIO io(Memfile_LeaseMgr::appendSuffix(base_name, type));
io.removeFile();
}
......
// Copyright (C) 2011,2014 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011,2014,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
......@@ -80,7 +80,6 @@ void initLogger(isc::log::Severity severity, int dbglevel) {
// Root logger name is defined by the environment variable KEA_LOGGER_ROOT.
// If not present, the name is "kea".
const char* DEFAULT_ROOT = "kea";
const char* root = getenv("KEA_LOGGER_ROOT");
if (! root) {
// If not present, the name is "kea".
......
......@@ -30,7 +30,14 @@ namespace util {
/// avoid exposing the internals of the implementation, such as
/// custom handling of a SIGCHLD signal, and the conversion of the
/// arguments of the executable from the STL container to the array.
class ProcessSpawnImpl {
///
/// 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 code from flagging the
/// lack of a copy constructor as an issue.
class ProcessSpawnImpl : boost::noncopyable {
public:
/// @brief Constructor.
......
......@@ -16,6 +16,7 @@
#define PROCESS_SPAWN_H
#include <exceptions/exceptions.h>
#include <boost/noncopyable.hpp>
#include <string>
#include <sys/types.h>
#include <vector>
......@@ -53,10 +54,18 @@ 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.
///
/// 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 code 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
/// SIGCHLD signal handler.
class ProcessSpawn {
class ProcessSpawn : boost::noncopyable {
public:
/// @brief Constructor.
......
// 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
......@@ -247,7 +247,7 @@ void memfile_uBenchmark::createLease4Test() {
lease->cltt = cltt;
lease->pool_id = pool_id;
lease->fixed = fixed;
lease->hostname = "foo";
lease->hostname = hostname;
lease->fqdn_fwd = fqdn_fwd;
lease->fqdn_rev = fqdn_rev;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment