From: JINMEI Tatuya Date: Thu, 9 Feb 2012 01:38:36 +0000 (-0800) Subject: [1596] constify X-Git-Tag: trac2351_base~97^2~32^2~3^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=308d0c39eade6985c4f61feb215255cf2ec92abf;p=thirdparty%2Fkea.git [1596] constify --- diff --git a/src/bin/auth/command.cc b/src/bin/auth/command.cc index b1cc2eed9e..820596aaa0 100644 --- a/src/bin/auth/command.cc +++ b/src/bin/auth/command.cc @@ -116,8 +116,8 @@ public: if (args && args->getType() == isc::data::Element::map && args->contains("pid")) { // If it is, we check it is the same as our PID - int pid(args->get("pid")->intValue()); - pid_t my_pid(getpid()); + const int pid(args->get("pid")->intValue()); + const pid_t my_pid(getpid()); if (my_pid != pid) { // It is not for us return; diff --git a/src/bin/auth/tests/command_unittest.cc b/src/bin/auth/tests/command_unittest.cc index d14ff6b5be..9eaf2811fa 100644 --- a/src/bin/auth/tests/command_unittest.cc +++ b/src/bin/auth/tests/command_unittest.cc @@ -117,7 +117,7 @@ TEST_F(AuthCommandTest, shutdown) { TEST_F(AuthCommandTest, shutdownCorrectPID) { // Put the pid parameter there - pid_t pid(getpid()); + const pid_t pid(getpid()); ElementPtr param(new isc::data::MapElement()); param->set("pid", ConstElementPtr(new isc::data::IntElement(pid))); this->param = param; diff --git a/src/bin/resolver/main.cc b/src/bin/resolver/main.cc index c4797597c0..eed33781dd 100644 --- a/src/bin/resolver/main.cc +++ b/src/bin/resolver/main.cc @@ -90,8 +90,8 @@ my_command_handler(const string& command, ConstElementPtr args) { if (args && args->getType() == isc::data::Element::map && args->contains("pid")) { // If it is, we check it is the same as our PID - int pid(args->get("pid")->intValue()); - pid_t my_pid(getpid()); + const int pid(args->get("pid")->intValue()); + const pid_t my_pid(getpid()); if (my_pid != pid) { // It is not for us return (answer);