__cgfsng_ops static bool cgfsng_attach(struct cgroup_ops *ops, const char *name,
const char *lxcpath, pid_t pid)
{
- int i, len, ret;
+ int len, ret;
char pidstr[INTTYPE_TO_STRLEN(pid_t)];
if (!ops->hierarchies)
if (len < 0 || (size_t)len >= sizeof(pidstr))
return false;
- for (i = 0; ops->hierarchies[i]; i++) {
- __do_free char *path = NULL;
- char *fullpath = NULL;
+ for (int i = 0; ops->hierarchies[i]; i++) {
+ __do_free char *fullpath = NULL, *path = NULL;
struct hierarchy *h = ops->hierarchies[i];
if (h->version == CGROUP2_SUPER_MAGIC) {
}
__cgfsng_ops static bool cgfsng_setup_limits(struct cgroup_ops *ops,
- struct lxc_conf *conf,
- bool do_devices)
+ struct lxc_conf *conf,
+ bool do_devices)
{
- bool bret;
-
- bret = __cg_legacy_setup_limits(ops, &conf->cgroup, do_devices);
- if (!bret)
+ if (!__cg_legacy_setup_limits(ops, &conf->cgroup, do_devices))
return false;
return __cg_unified_setup_limits(ops, &conf->cgroup2);
static bool cgroup_use_wants_controllers(const struct cgroup_ops *ops,
char **controllers)
{
- char **cur_ctrl, **cur_use;
-
if (!ops->cgroup_use)
return true;
- for (cur_ctrl = controllers; cur_ctrl && *cur_ctrl; cur_ctrl++) {
+ for (char **cur_ctrl = controllers; cur_ctrl && *cur_ctrl; cur_ctrl++) {
bool found = false;
- for (cur_use = ops->cgroup_use; cur_use && *cur_use; cur_use++) {
+ for (char **cur_use = ops->cgroup_use; cur_use && *cur_use; cur_use++) {
if (strcmp(*cur_use, *cur_ctrl) != 0)
continue;