Commit f15c13fb authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[1596] Remove unneeded checks

They'd get caught by an exception anyway.
parent da724029
......@@ -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
......
......@@ -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());
......
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