]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1596] Remove unneeded checks
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Tue, 14 Feb 2012 08:56:55 +0000 (09:56 +0100)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Tue, 14 Feb 2012 08:56:55 +0000 (09:56 +0100)
They'd get caught by an exception anyway.

src/bin/auth/command.cc
src/bin/resolver/main.cc

index 1b440db0f51c452643f262cf8a9b166dcadf1524..ad0d134f88a8f1ec2edd1158b4e29b905c3076ec 100644 (file)
@@ -109,8 +109,7 @@ class ShutdownCommand : public AuthCommand {
 public:
     virtual void exec(AuthSrv& server, isc::data::ConstElementPtr args) {
         // Is the pid argument provided?
-        if (args && args->getType() == isc::data::Element::map &&
-            args->contains("pid")) {
+        if (args && args->contains("pid")) {
             // If it is, we check it is the same as our PID
 
             // This might throw in case the type is not an int, but that's
index b390f3349c26b0da2262e0e072bcbca65ce31c2c..1cf7f9e1c640f1c375d19305ab1b5932ffacd581 100644 (file)
@@ -88,8 +88,7 @@ my_command_handler(const string& command, ConstElementPtr args) {
             answer = createAnswer(0, args);
         } else if (command == "shutdown") {
             // Is the pid argument provided?
-            if (args && args->getType() == isc::data::Element::map &&
-                args->contains("pid")) {
+            if (args && args->contains("pid")) {
                 // If it is, we check it is the same as our PID
                 const int pid(args->get("pid")->intValue());
                 const pid_t my_pid(getpid());