Browse Source

[1596] constify

JINMEI Tatuya 13 years ago
parent
commit
308d0c39ea
3 changed files with 5 additions and 5 deletions
  1. 2 2
      src/bin/auth/command.cc
  2. 1 1
      src/bin/auth/tests/command_unittest.cc
  3. 2 2
      src/bin/resolver/main.cc

+ 2 - 2
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;

+ 1 - 1
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;

+ 2 - 2
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);