Unverified Commit 90ddf3c0 by Stéphane Graber Committed by GitHub

Merge pull request #3249 from brauner/2020-01-09/bugfixes

handle kernel version <--> header incompatibility
parents f036cc8a c718fac1
...@@ -65,6 +65,7 @@ int lxc_mainloop_add_handler(struct lxc_epoll_descr *descr, int fd, ...@@ -65,6 +65,7 @@ int lxc_mainloop_add_handler(struct lxc_epoll_descr *descr, int fd,
struct epoll_event ev; struct epoll_event ev;
struct mainloop_handler *handler; struct mainloop_handler *handler;
struct lxc_list *item; struct lxc_list *item;
if (fd < 0) if (fd < 0)
return -1; return -1;
......
...@@ -1091,11 +1091,13 @@ void lxc_abort(const char *name, struct lxc_handler *handler) ...@@ -1091,11 +1091,13 @@ void lxc_abort(const char *name, struct lxc_handler *handler)
lxc_set_state(name, handler, ABORTING); lxc_set_state(name, handler, ABORTING);
if (handler->pidfd >= 0) if (handler->pidfd >= 0) {
ret = lxc_raw_pidfd_send_signal(handler->pidfd, SIGKILL, NULL, 0); ret = lxc_raw_pidfd_send_signal(handler->pidfd, SIGKILL, NULL, 0);
else if (handler->pid > 0) if (ret)
ret = kill(handler->pid, SIGKILL); SYSWARN("Failed to send SIGKILL via pidfd %d for process %d", handler->pidfd, handler->pid);
if (ret < 0) }
if (ret && (errno != ESRCH) && kill(handler->pid, SIGKILL))
SYSERROR("Failed to send SIGKILL to %d", handler->pid); SYSERROR("Failed to send SIGKILL to %d", handler->pid);
do { do {
......
...@@ -84,7 +84,7 @@ int main(int argc, char *argv[]) ...@@ -84,7 +84,7 @@ int main(int argc, char *argv[])
*/ */
sleep(5); sleep(5);
if (!c->reboot2(c, -1)) { if (!c->reboot2(c, 60)) {
lxc_error("%s\n", "Failed to reboot container \"reboot\""); lxc_error("%s\n", "Failed to reboot container \"reboot\"");
goto on_error_stop; goto on_error_stop;
} }
......
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