From: Christian Brauner Date: Thu, 16 Jan 2020 17:02:35 +0000 (+0100) Subject: start: fix container killing logic X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=183bda09237f4923c91ec3a567b1cfe2c77f6dea;p=thirdparty%2Flxc.git start: fix container killing logic We need to account for the case where pidfd's are not supported by the kernel in question. Closes: #3254 Signed-off-by: Christian Brauner --- diff --git a/src/lxc/start.c b/src/lxc/start.c index 224150386..917788e4a 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1079,11 +1079,13 @@ void lxc_abort(const char *name, struct lxc_handler *handler) if (handler->pidfd >= 0) { ret = lxc_raw_pidfd_send_signal(handler->pidfd, SIGKILL, NULL, 0); if (ret) - SYSWARN("Failed to send SIGKILL via pidfd %d for process %d", handler->pidfd, handler->pid); + SYSWARN("Failed to send SIGKILL via pidfd %d for process %d", + handler->pidfd, handler->pid); } - if (ret && (errno != ESRCH) && kill(handler->pid, SIGKILL)) - SYSERROR("Failed to send SIGKILL to %d", handler->pid); + if (!ret || errno != ESRCH) + if (kill(handler->pid, SIGKILL)) + SYSWARN("Failed to send SIGKILL to %d", handler->pid); do { ret = waitpid(-1, &status, 0);