When no console is specified, do not try to setup the console.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
return 0;
}
- if (console->peer == -1)
+ if (console->peer == -1) {
INFO("no console output required");
+ return 0;
+ }
if (stat(path, &s)) {
SYSERROR("failed to stat '%s'", path);
if (!conf->rootfs)
return 0;
+ if (!console->path)
+ return 0;
+
if (openpty(&console->master, &console->slave,
console->name, NULL, NULL)) {
SYSERROR("failed to allocate a pty");
return 0;
}
+ if (!console->path) {
+ INFO("no console specified");
+ return 0;
+ }
+
if (lxc_mainloop_add_handler(descr, console->master,
console_handler, console)) {
ERROR("failed to add to mainloop console handler for '%d'",