Skip to content

Commit

Permalink
conf: fix lxc_setup_dev_console()
Browse files Browse the repository at this point in the history
We were printing garbage on accident.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 26, 2021
1 parent 7ce4f69 commit f4c4328
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/lxc/conf.c
Expand Up @@ -1664,14 +1664,14 @@ static int lxc_setup_dev_console(const struct lxc_rootfs *rootfs,
if (pty_mnt_fd >= 0) {
ret = move_mount(pty_mnt_fd, "", rootfs->dev_mntpt_fd, "console", MOVE_MOUNT_F_EMPTY_PATH);
if (!ret) {
DEBUG("Moved mount \"%s\" onto \"%s\"", console->name, path);
goto finish;
DEBUG("Moved mount \"%s\" onto %d(console)", console->name, rootfs->dev_mntpt_fd);
return 0;
}

if (ret && errno != ENOSYS)
return log_error_errno(-1, errno,
"Failed to mount %d(%s) on \"%s\"",
pty_mnt_fd, console->name, path);
"Failed to mount %d(%s) on %d(console)",
pty_mnt_fd, console->name, rootfs->dev_mntpt_fd);
}

ret = safe_mount_beneath_at(rootfs->dev_mntpt_fd, console->name, "console", NULL, MS_BIND, NULL);
Expand All @@ -1687,7 +1687,6 @@ static int lxc_setup_dev_console(const struct lxc_rootfs *rootfs,
}
}

finish:
DEBUG("Mounted pty device %d(%s) onto \"%s\"", pty_mnt_fd, console->name, path);
return 0;
}
Expand Down

0 comments on commit f4c4328

Please sign in to comment.