}
}
- ret = lxc_config_define_load(&defines, c);
- if (ret) {
+ bret = lxc_config_define_load(&defines, c);
+ if (!bret) {
lxc_container_put(c);
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
- ret = c->set_config_item(c, "lxc.init.uid", buf);
- if (ret < 0) {
+ bret = c->set_config_item(c, "lxc.init.uid", buf);
+ if (!bret) {
lxc_container_put(c);
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
- ret = c->set_config_item(c, "lxc.init.gid", buf);
- if (ret < 0) {
+ bret = c->set_config_item(c, "lxc.init.gid", buf);
+ if (!bret) {
lxc_container_put(c);
exit(EXIT_FAILURE);
}
goto out;
}
- if (lxc_config_define_load(&defines, c))
+ if (!lxc_config_define_load(&defines, c))
goto out;
if (!rcfile && !strcmp("/sbin/init", args[0])) {
return 0;
}
-int lxc_config_define_load(struct lxc_list *defines, struct lxc_container *c)
+bool lxc_config_define_load(struct lxc_list *defines, struct lxc_container *c)
{
struct lxc_list *it;
- int ret = 0;
+ bool bret = true;
lxc_list_for_each(it, defines) {
struct new_config_item *new_item = it->elem;
- ret = c->set_config_item(c, new_item->key, new_item->val);
- if (ret < 0)
+ bret = c->set_config_item(c, new_item->key, new_item->val);
+ if (!bret)
break;
}
lxc_config_define_free(defines);
- return ret;
+ return bret;
}
void lxc_config_define_free(struct lxc_list *defines)
extern bool switch_to_ns(pid_t pid, const char *ns);
extern int lxc_config_define_add(struct lxc_list *defines, char *arg);
-extern int lxc_config_define_load(struct lxc_list *defines,
- struct lxc_container *c);
+extern bool lxc_config_define_load(struct lxc_list *defines,
+ struct lxc_container *c);
extern void lxc_config_define_free(struct lxc_list *defines);
extern int lxc_char_left_gc(const char *buffer, size_t len);
extern int lxc_char_right_gc(const char *buffer, size_t len);