This reverts part of the move-user-code patch. generic_console_write somehow behaves differently when inside chan_kern.c, causing UML to hang. Signed-off-by: Paolo 'Blaisorblade' Giarrusso --- um-linux-2.4.27-paolo/arch/um/drivers/chan_kern.c | 16 ---------------- um-linux-2.4.27-paolo/arch/um/drivers/chan_user.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff -puN arch/um/drivers/chan_kern.c~move_console_write arch/um/drivers/chan_kern.c --- um-linux-2.4.27/arch/um/drivers/chan_kern.c~move_console_write 2005-04-15 11:12:45.000000000 +0200 +++ um-linux-2.4.27-paolo/arch/um/drivers/chan_kern.c 2005-04-15 11:12:45.000000000 +0200 @@ -113,22 +113,6 @@ int generic_write(int fd, const char *bu return(os_write_file(fd, buf, n)); } -int generic_console_write(int fd, const char *buf, int n, void *unused) -{ - struct termios save, new; - int err; - - if(isatty(fd)){ - tcgetattr(fd, &save); - new = save; - new.c_oflag |= OPOST; - tcsetattr(fd, TCSAFLUSH, &new); - } - err = generic_write(fd, buf, n, NULL); - if(isatty(fd)) tcsetattr(fd, TCSAFLUSH, &save); - return(err); -} - int generic_window_size(int fd, void *unused, unsigned short *rows_out, unsigned short *cols_out) { diff -puN arch/um/drivers/chan_user.c~move_console_write arch/um/drivers/chan_user.c --- um-linux-2.4.27/arch/um/drivers/chan_user.c~move_console_write 2005-04-15 11:12:45.000000000 +0200 +++ um-linux-2.4.27-paolo/arch/um/drivers/chan_user.c 2005-04-15 11:12:45.000000000 +0200 @@ -31,6 +31,22 @@ struct winch_data { int close_me; }; +int generic_console_write(int fd, const char *buf, int n, void *unused) +{ + struct termios save, new; + int err; + + if(isatty(fd)){ + tcgetattr(fd, &save); + new = save; + new.c_oflag |= OPOST; + tcsetattr(fd, TCSAFLUSH, &new); + } + err = generic_write(fd, buf, n, NULL); + if(isatty(fd)) tcsetattr(fd, TCSAFLUSH, &save); + return(err); +} + static int winch_thread(void *arg) { struct winch_data *data = arg; _