# HG changeset patch # User Tristan Gingold # Date 1200461143 -3600 # Node ID 0353ead264baea1eac7fb35c622c69f45f3935df # Parent ca2828a46217bec2096144d2bc96b1d610272f30 Make slave pty raw during initialization. (This avoids echo). Signed-off-by: Tristan Gingold diff -r ca2828a46217 -r 0353ead264ba tools/console/daemon/io.c --- a/tools/console/daemon/io.c Wed Jan 16 06:21:50 2008 +0100 +++ b/tools/console/daemon/io.c Wed Jan 16 06:25:43 2008 +0100 @@ -278,8 +278,10 @@ static int openpty(int *amaster, int *as if (winp) ioctl(sfd, TIOCSWINSZ, winp); + if (termp) + tcsetattr(sfd, TCSAFLUSH, termp); + assert(name == NULL); - assert(termp == NULL); return 0; @@ -299,11 +301,14 @@ static int domain_create_tty(struct doma bool success; char *data; unsigned int len; + struct termios term; assert(dom->slave_fd == -1); assert(dom->master_fd == -1); - if (openpty(&dom->master_fd, &dom->slave_fd, NULL, NULL, NULL) < 0) { + cfmakeraw(&term); + + if (openpty(&dom->master_fd, &dom->slave_fd, NULL, &term, NULL) < 0) { err = errno; dolog(LOG_ERR, "Failed to create tty for domain-%d (errno = %i, %s)", dom->domid, err, strerror(err));