]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1596] constify
authorJINMEI Tatuya <jinmei@isc.org>
Thu, 9 Feb 2012 01:38:36 +0000 (17:38 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Thu, 9 Feb 2012 01:38:36 +0000 (17:38 -0800)
src/bin/auth/command.cc
src/bin/auth/tests/command_unittest.cc
src/bin/resolver/main.cc

index b1cc2eed9e6e5fb05079df3a3ce5d00378e1b86a..820596aaa02828ab98595c8a4501d5b97d6d05bb 100644 (file)
@@ -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;
index d14ff6b5be6d66141216a5f9f2523046001891cc..9eaf2811fabdafa1c200c6b1f2095676e56297c5 100644 (file)
@@ -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;
index c4797597c0e01f37ed60dcda9b606bc745ecf20e..eed33781ddef944b5f08ee241669c7f05fa56065 100644 (file)
@@ -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);