# This reverts part of the move-user-code patch. generic_console_write # somehow behaves differently when inside chan_kern.c, causing UML to # hang. Index: um/arch/um/drivers/chan_kern.c =================================================================== --- um.orig/arch/um/drivers/chan_kern.c 2004-08-06 15:17:08.000000000 -0400 +++ um/arch/um/drivers/chan_kern.c 2004-08-06 16:29:49.000000000 -0400 @@ -113,22 +113,6 @@ 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) { Index: um/arch/um/drivers/chan_user.c =================================================================== --- um.orig/arch/um/drivers/chan_user.c 2004-08-06 15:17:08.000000000 -0400 +++ um/arch/um/drivers/chan_user.c 2004-08-06 16:29:49.000000000 -0400 @@ -31,6 +31,25 @@ int close_me; }; +/* XXX This breaks horribly (by hanging UML) when moved to chan_kern.c - + * needs investigation + */ +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;