Skip to content

Commit

Permalink
Merge pull request lxc#3150 from brauner/2019-10-04/pidfd_fixes
Browse files Browse the repository at this point in the history
start: pidfds obviously start - like any fd - at 0
  • Loading branch information
hallyn authored Oct 4, 2019
2 parents 39eaee5 + d168749 commit 1d24b87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lxc/start.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1d24b87

Please sign in to comment.