1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

replace setbuf with setvbuf, from Frederic Nowak

This commit is contained in:
tedu 2015-11-04 21:22:10 +00:00
parent fa575ea25f
commit 33206277fe
8 changed files with 16 additions and 16 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: graphics.c,v 1.9 2014/07/13 13:00:40 tedu Exp $ */
/* $OpenBSD: graphics.c,v 1.10 2015/11/04 21:22:10 tedu Exp $ */
/* $NetBSD: graphics.c,v 1.3 1995/03/21 15:04:04 cgd Exp $ */
/*-
@ -117,7 +117,7 @@ setup_screen(const C_SCREEN *scp)
endwin();
errx(1, "screen too small.");
}
setbuf(stdout, buffer);
setvbuf(stdout, buffer, _IOFBF, sizeof buffer);
input = newwin(INPUT_LINES, COLS - PLANE_COLS, LINES - INPUT_LINES, 0);
credit = newwin(INPUT_LINES, PLANE_COLS, LINES - INPUT_LINES,
COLS - PLANE_COLS);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: main.c,v 1.27 2014/12/07 19:56:19 deraadt Exp $ */
/* $OpenBSD: main.c,v 1.28 2015/11/04 21:22:10 tedu Exp $ */
/*
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
@ -155,7 +155,7 @@ again:
clrtoeol();
}
} else {
setbuf(stdout, 0);
setvbuf(stdout, NULL, _IONBF, 0);
get_line(buf, sizeof(buf));
if (strcmp(buf, "black") == 0)
color = BLACK;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: hack.main.c,v 1.17 2015/09/27 05:13:11 guenther Exp $ */
/* $OpenBSD: hack.main.c,v 1.18 2015/11/04 21:22:10 tedu Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@ -175,7 +175,7 @@ main(int argc, char **argv)
* Remember tty modes, to be restored on exit.
*/
gettty();
setbuf(stdout,obuf);
setvbuf(stdout, obuf, _IOFBF, sizeof obuf);
umask(007);
startup();
cls();

View File

@ -1,4 +1,4 @@
/* $OpenBSD: mille.c,v 1.20 2015/01/19 00:47:01 deraadt Exp $ */
/* $OpenBSD: mille.c,v 1.21 2015/11/04 21:22:10 tedu Exp $ */
/* $NetBSD: mille.c,v 1.4 1995/03/24 05:01:48 cgd Exp $ */
/*
@ -48,7 +48,7 @@ main(ac, av)
#ifdef DEBUG
if (strcmp(av[0], "a.out") == 0) {
outf = fopen("q", "w");
setbuf(outf, (char *)NULL);
setvbuf(outf, NULL, _IONBF, 0);
Debug = TRUE;
}
#endif

View File

@ -1,4 +1,4 @@
/* $OpenBSD: move.c,v 1.14 2015/10/24 17:51:59 mmcc Exp $ */
/* $OpenBSD: move.c,v 1.15 2015/11/04 21:22:10 tedu Exp $ */
/* $NetBSD: move.c,v 1.4 1995/03/24 05:01:57 cgd Exp $ */
/*
@ -442,7 +442,7 @@ over:
leaveok(Board, TRUE);
if ((outf = fopen(buf, "w")) == NULL)
warn("%s", buf);
setbuf(outf, (char *)NULL);
setvbuf(outf, NULL, _IONBF, 0);
}
Debug = !Debug;
break;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: varpush.c,v 1.8 2015/01/19 00:47:01 deraadt Exp $ */
/* $OpenBSD: varpush.c,v 1.9 2015/11/04 21:22:10 tedu Exp $ */
/* $NetBSD: varpush.c,v 1.4 1995/03/24 05:02:35 cgd Exp $ */
/*
@ -85,7 +85,7 @@ over:
goto over;
}
if (strcmp(buf, _PATH_DEVNULL) != 0)
setbuf(outf, (char *)NULL);
setvbuf(outf, NULL, _IONBF, 0);
}
#endif
} else {

View File

@ -1,4 +1,4 @@
/* $OpenBSD: random.c,v 1.13 2015/10/14 08:12:12 doug Exp $ */
/* $OpenBSD: random.c,v 1.14 2015/11/04 21:22:10 tedu Exp $ */
/* $NetBSD: random.c,v 1.3 1995/04/22 07:44:05 cgd Exp $ */
/*
@ -101,7 +101,7 @@ main(int argc, char *argv[])
* to write to the standard output.
*/
if (unbuffer_output)
setbuf(stdout, NULL);
setvbuf(stdout, NULL, _IONBF, 0);
/*
* Select whether to print the first line. (Prime the pump.)

View File

@ -1,4 +1,4 @@
/* $OpenBSD: worm.c,v 1.32 2015/08/26 01:25:57 rzalamena Exp $ */
/* $OpenBSD: worm.c,v 1.33 2015/11/04 21:22:10 tedu Exp $ */
/*
* Copyright (c) 1980, 1993
@ -94,7 +94,7 @@ main(int argc, char **argv)
timespecclear(&t);
setbuf(stdout, outbuf);
setvbuf(stdout, outbuf, _IOFBF, sizeof outbuf);
signal(SIGINT, leave);
signal(SIGQUIT, leave);
signal(SIGTSTP, suspend); /* process control signal */