now container pty output log, use \r\n as a newline flag.
This is a windows type, so we need to change it. By clear
ONLCR can reach it.
Signed-off-by: duguhaotian <duguhaotian@gmail.com>
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
+#include <termios.h>
#include <grp.h>
#include <pwd.h>
#include <signal.h>
struct lxc_terminal *terminal)
{
int ret;
+ struct termios oldtios;
lxc_terminal_init(terminal);
return -1;
}
+ ret = lxc_setup_tios(terminal->master, &oldtios);
+ if (ret < 0) {
+ SYSERROR("Failed to setup terminal");
+ return -1;
+ }
+
/* Shift ttys to container. */
ret = lxc_terminal_map_ids(conf, terminal);
if (ret < 0) {
#ifdef IEXTEN
newtios.c_lflag &= ~IEXTEN;
#endif
+ newtios.c_oflag &= ~ONLCR;
newtios.c_oflag |= OPOST;
newtios.c_cc[VMIN] = 1;
newtios.c_cc[VTIME] = 0;
{
int ret;
struct lxc_terminal *terminal = &conf->console;
+ struct termios oldtios;
if (terminal->path && strcmp(terminal->path, "none") == 0) {
INFO("No terminal requested");
if (ret < 0)
return -1;
+ ret = lxc_setup_tios(terminal->master, &oldtios);
+ if (ret < 0)
+ return -1;
+
ret = lxc_terminal_create_log_file(terminal);
if (ret < 0)
goto err;