start: pidfds obviously start - like any fd - at 0

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2019-10-04 10:31:41 +02:00
parent d62ac98582
commit d1687497fb
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D

View File

@ -1112,9 +1112,9 @@ void lxc_abort(const char *name, struct lxc_handler *handler)
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);
else if (handler->proc_pidfd > 0)
else if (handler->proc_pidfd >= 0)
ret = lxc_raw_pidfd_send_signal(handler->proc_pidfd, SIGKILL, NULL, 0);
else if (handler->pid > 0)
ret = kill(handler->pid, SIGKILL);