Commit 6118210e by Wolfgang Bumiller

tools: set configfile after load_config

In order to cause c->is_defined() to become true. Signed-off-by: 's avatarWolfgang Bumiller <w.bumiller@proxmox.com>
parent 50b737a3
......@@ -385,6 +385,12 @@ int main(int argc, char *argv[])
lxc_container_put(c);
exit(EXIT_FAILURE);
}
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
ERROR("Out of memory setting new config filename");
lxc_container_put(c);
exit(EXIT_FAILURE);
}
}
if (!c->may_control(c)) {
......
......@@ -92,6 +92,12 @@ int main(int argc, char *argv[])
lxc_container_put(c);
return 1;
}
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
ERROR("Out of memory setting new config filename");
lxc_container_put(c);
return 1;
}
}
if (!c->may_control(c)) {
......
......@@ -222,6 +222,12 @@ int main(int argc, char *argv[])
lxc_container_put(c);
exit(1);
}
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
lxc_container_put(c);
exit(1);
}
}
if (!c->may_control(c)) {
......
......@@ -120,6 +120,12 @@ int main(int argc, char *argv[])
lxc_container_put(c);
exit(EXIT_FAILURE);
}
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
lxc_container_put(c);
exit(EXIT_FAILURE);
}
}
if (!c->may_control(c)) {
......
......@@ -217,6 +217,11 @@ int main(int argc, char *argv[])
fprintf(stderr, "Failed to load rcfile\n");
goto out;
}
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
goto out;
}
}
if (!c->may_control(c)) {
......
......@@ -96,6 +96,12 @@ int main(int argc, char *argv[])
lxc_container_put(c);
exit(EXIT_FAILURE);
}
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
lxc_container_put(c);
exit(EXIT_FAILURE);
}
}
if (!c->may_control(c)) {
......
......@@ -132,6 +132,11 @@ int main(int argc, char *argv[])
ERROR("Failed to load rcfile");
goto err1;
}
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
ERROR("Out of memory setting new config filename");
goto err1;
}
}
if (!c->is_running(c)) {
......
......@@ -82,6 +82,12 @@ int main(int argc, char *argv[])
lxc_container_put(c);
exit(1);
}
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
ERROR("Out of memory setting new config filename");
lxc_container_put(c);
exit(1);
}
}
if (!c->may_control(c)) {
......
......@@ -303,6 +303,12 @@ static int print_info(const char *name, const char *lxcpath)
lxc_container_put(c);
return -1;
}
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
lxc_container_put(c);
return -1;
}
}
if (!c->may_control(c)) {
......
......@@ -115,6 +115,12 @@ int main(int argc, char *argv[])
lxc_container_put(c);
exit(EXIT_FAILURE);
}
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
lxc_container_put(c);
exit(EXIT_FAILURE);
}
}
if (!c->may_control(c)) {
......
......@@ -210,6 +210,11 @@ int main(int argc, char *argv[])
fprintf(stderr, "Failed to load rcfile\n");
goto out;
}
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
goto out;
}
}
if (!c->may_control(c)) {
......
......@@ -86,6 +86,12 @@ int main(int argc, char *argv[])
lxc_container_put(c);
exit(1);
}
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
ERROR("Out of memory setting new config filename");
lxc_container_put(c);
exit(1);
}
}
if (!c->unfreeze(c)) {
......
......@@ -112,6 +112,12 @@ int main(int argc, char *argv[])
lxc_container_put(c);
return 1;
}
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
lxc_container_put(c);
return 1;
}
}
if (!c->wait(c, my_args.states, my_args.timeout)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment