Skip to content

Commit

Permalink
commands: don't fail if unfreeze fails
Browse files Browse the repository at this point in the history
We can e.g. fail the unfreeze because the freezer cgroup is not available and
then we erronously report that stopping the container failed.

Closes: #3471.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Oct 19, 2020
1 parent f59f2f9 commit 422820d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/lxc/commands.c
Expand Up @@ -894,12 +894,11 @@ static int lxc_cmd_stop_callback(int fd, struct lxc_cmd_req *req,
else
TRACE("Sent signal %d to pidfd %d", stopsignal, handler->pid);

rsp.ret = cgroup_ops->unfreeze(cgroup_ops, -1);
if (!rsp.ret)
return 0;
ret = cgroup_ops->unfreeze(cgroup_ops, -1);
if (ret)
WARN("Failed to unfreeze container \"%s\"", handler->name);

ERROR("Failed to unfreeze container \"%s\"", handler->name);
rsp.ret = -errno;
return 0;
} else {
rsp.ret = -errno;
}
Expand Down

0 comments on commit 422820d

Please sign in to comment.