[server] remove logically dead code per Coverity scan

This commit is contained in:
Michael Rash
2018-08-20 18:47:54 -07:00
parent e82cb8621f
commit 369cd89e5e

View File

@@ -677,17 +677,24 @@ static int stop_fwknopd(fko_srv_options_t * const opts)
}
sleep(1);
}
if(is_err != 0)
/* if we make it here at all, then we were unsuccessful with the
* above attempt to kill the process with SIGTERM
*/
res = kill(old_pid, SIGKILL);
is_err = kill(old_pid, 0);
if(res == 0 && is_err != 0)
{
fprintf(stdout, "Killed fwknopd (pid=%i) via SIGTERM\n",
fprintf(stdout,
"Killed fwknopd (pid=%i) via SIGKILL\n",
old_pid);
return EXIT_SUCCESS;
}
else
{
res = kill(old_pid, SIGKILL);
sleep(1);
is_err = kill(old_pid, 0);
if(res == 0 && is_err != 0)
if(is_err != 0)
{
fprintf(stdout,
"Killed fwknopd (pid=%i) via SIGKILL\n",
@@ -696,20 +703,8 @@ static int stop_fwknopd(fko_srv_options_t * const opts)
}
else
{
sleep(1);
is_err = kill(old_pid, 0);
if(is_err != 0)
{
fprintf(stdout,
"Killed fwknopd (pid=%i) via SIGKILL\n",
old_pid);
return EXIT_SUCCESS;
}
else
{
perror("Unable to kill fwknop: ");
return EXIT_FAILURE;
}
perror("Unable to kill fwknop: ");
return EXIT_FAILURE;
}
}
}