X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fs390%2Fchar%2Fsclp_vt220.c;fp=drivers%2Fs390%2Fchar%2Fsclp_vt220.c;h=9e02625c82cfc2853b3fa5be86fb883ddb82c8c2;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=06bd85824d7bcf822ddd91b614f49ee70e5d0247;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c index 06bd85824..9e02625c8 100644 --- a/drivers/s390/char/sclp_vt220.c +++ b/drivers/s390/char/sclp_vt220.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -482,16 +483,7 @@ sclp_vt220_receiver_fn(struct evbuf_header *evbuf) /* Send input to line discipline */ buffer++; count--; - /* Prevent buffer overrun by discarding input. Note that - * because buffer_push works asynchronously, we cannot wait - * for the buffer to be emptied. */ - if (count + sclp_vt220_tty->flip.count > TTY_FLIPBUF_SIZE) - count = TTY_FLIPBUF_SIZE - sclp_vt220_tty->flip.count; - memcpy(sclp_vt220_tty->flip.char_buf_ptr, buffer, count); - memset(sclp_vt220_tty->flip.flag_buf_ptr, TTY_NORMAL, count); - sclp_vt220_tty->flip.char_buf_ptr += count; - sclp_vt220_tty->flip.flag_buf_ptr += count; - sclp_vt220_tty->flip.count += count; + tty_insert_flip_string(sclp_vt220_tty, buffer, count); tty_flip_buffer_push(sclp_vt220_tty); break; }