client: Avoid needless error messages about kill failing. Only call kill_by_switcher() if we are running in sandbox mode, otherwise call kill.

This commit is contained in:
Rom Walton 2014-07-27 12:54:07 -04:00
parent 6c76387a14
commit 329b5a6ab6
1 changed files with 16 additions and 15 deletions

View File

@ -219,21 +219,22 @@ static void kill_app_process(int pid, bool will_restart) {
#else
static void kill_app_process(int pid, bool) {
int retval = 0;
#ifdef SANDBOX
retval = kill_via_switcher(pid);
if (retval && log_flags.task_debug) {
msg_printf(0, MSG_INFO,
"[task] kill_via_switcher() failed: %s",
(retval==-1) ? strerror(errno) : boincerror(retval)
);
}
#endif
retval = kill(pid, SIGKILL);
if (retval && log_flags.task_debug) {
msg_printf(0, MSG_INFO,
"[task] kill() failed: %s",
(retval==-1) ? strerror(errno) : boincerror(retval)
);
if (g_use_sandbox) {
retval = kill_via_switcher(pid);
if (retval && log_flags.task_debug) {
msg_printf(0, MSG_INFO,
"[task] kill_via_switcher() failed: %s",
(retval) ? strerror(errno) : boincerror(retval)
);
}
} else {
retval = kill(pid, SIGKILL);
if (retval && log_flags.task_debug) {
msg_printf(0, MSG_INFO,
"[task] kill() failed: %s",
(retval==-1) ? strerror(errno) : boincerror(retval)
);
}
}
}
#endif