turn off line buffering in __startwin(), turn it back on in endwin()
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 11 May 1993 03:13:53 +0000 (19:13 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 11 May 1993 03:13:53 +0000 (19:13 -0800)
SCCS-vsn: lib/libcurses/tty.c 5.10

usr/src/lib/libcurses/tty.c

index bbb6ed4..81bc54a 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)tty.c      5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)tty.c      5.10 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -141,6 +141,16 @@ nonl()
                return (tcsetattr(STDIN_FILENO, TCSADRAIN, &norawt));
 }
 
                return (tcsetattr(STDIN_FILENO, TCSADRAIN, &norawt));
 }
 
+void
+__startwin()
+{
+       (void)fflush(stdout);
+       (void)setvbuf(stdout, NULL, _IOFBF, 0);
+
+       tputs(TI, 0, __cputchar);
+       tputs(VS, 0, __cputchar);
+}
+
 int
 endwin()
 {
 int
 endwin()
 {
@@ -155,6 +165,7 @@ endwin()
        (void)tputs(VE, 0, __cputchar);
        (void)tputs(TE, 0, __cputchar);
        (void)fflush(stdout);
        (void)tputs(VE, 0, __cputchar);
        (void)tputs(TE, 0, __cputchar);
        (void)fflush(stdout);
+       (void)setvbuf(stdout, NULL, _IOLBF, 0);
 
        __echoit = __orig_termios.c_lflag & ECHO;
        __rawmode = __orig_termios.c_lflag & ICANON;
 
        __echoit = __orig_termios.c_lflag & ECHO;
        __rawmode = __orig_termios.c_lflag & ICANON;
@@ -162,13 +173,6 @@ endwin()
        return (tcsetattr(STDIN_FILENO, TCSADRAIN, &__orig_termios));
 }
 
        return (tcsetattr(STDIN_FILENO, TCSADRAIN, &__orig_termios));
 }
 
-void
-__startwin()
-{
-       tputs(TI, 0, __cputchar);
-       tputs(VS, 0, __cputchar);
-}
-
 /*
  * The following routines, savetty and resetty are completely useless and
  * are left in only as stubs.  If people actually use them they will almost
 /*
  * The following routines, savetty and resetty are completely useless and
  * are left in only as stubs.  If people actually use them they will almost