diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2015-11-04 21:30:14 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2015-11-04 21:30:14 +0000 |
commit | 24a49b9e0a1ec6a532f66fa925116fa92385431a (patch) | |
tree | d2cfc1b344928908852403d2c1385bd86fb295c3 /regress | |
parent | fe653f86851f935866694a7f26effb787b99c01b (diff) |
replace setbuf with setvbuf, from Frederic Nowak
Diffstat (limited to 'regress')
-rw-r--r-- | regress/lib/libpthread/socket/1/socket1.c | 6 | ||||
-rw-r--r-- | regress/lib/libpthread/socket/2/socket2.c | 6 | ||||
-rw-r--r-- | regress/lib/libpthread/socket/2a/socket2a.c | 6 | ||||
-rw-r--r-- | regress/usr.sbin/syslogd/ttylog.c | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/regress/lib/libpthread/socket/1/socket1.c b/regress/lib/libpthread/socket/1/socket1.c index 11476fca1b0..7871558c538 100644 --- a/regress/lib/libpthread/socket/1/socket1.c +++ b/regress/lib/libpthread/socket/1/socket1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: socket1.c,v 1.3 2006/01/05 03:47:19 tedu Exp $ */ +/* $OpenBSD: socket1.c,v 1.4 2015/11/04 21:29:20 tedu Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996 by Chris Provenzano and contributors, * proven@mit.edu All rights reserved. @@ -176,8 +176,8 @@ main(int argc, char *argv[]) { pthread_t thread; - setbuf(stdout, NULL); - setbuf(stderr, NULL); + setvbuf(stdout, NULL, _IONBUF, 0); + setvbuf(stderr, NULL, _IONBUF, 0); CHECKr(pthread_attr_init(&attr)); #if 0 diff --git a/regress/lib/libpthread/socket/2/socket2.c b/regress/lib/libpthread/socket/2/socket2.c index 78ca83da110..f379ef82b33 100644 --- a/regress/lib/libpthread/socket/2/socket2.c +++ b/regress/lib/libpthread/socket/2/socket2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: socket2.c,v 1.6 2005/10/30 23:59:43 fgsch Exp $ */ +/* $OpenBSD: socket2.c,v 1.7 2015/11/04 21:29:20 tedu Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996 by Chris Provenzano and contributors, * proven@mit.edu All rights reserved. @@ -177,8 +177,8 @@ main(int argc, char *argv[]) { pthread_t thread; - setbuf(stdout, NULL); - setbuf(stderr, NULL); + setvbuf(stdout, NULL, _IONBF, 0); + setvbuf(stderr, NULL, _IONBF, 0); CHECKr(pthread_create(&thread, NULL, sock_accept, (void *)0xdeadbeaf)); diff --git a/regress/lib/libpthread/socket/2a/socket2a.c b/regress/lib/libpthread/socket/2a/socket2a.c index 4878a2bf16d..8c97e6a9650 100644 --- a/regress/lib/libpthread/socket/2a/socket2a.c +++ b/regress/lib/libpthread/socket/2a/socket2a.c @@ -1,4 +1,4 @@ -/* $OpenBSD: socket2a.c,v 1.4 2003/07/31 21:48:06 deraadt Exp $ */ +/* $OpenBSD: socket2a.c,v 1.5 2015/11/04 21:29:20 tedu Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996 by Chris Provenzano and contributors, * proven@mit.edu All rights reserved. @@ -100,8 +100,8 @@ main(int argc, char *argv[]) if (argc == 3 && (!strcmp(argv[1], "fork okay"))) { sleep(1); - setbuf(stdout, NULL); - setbuf(stderr, NULL); + setvbuf(stdout, NULL, _IONBF, 0); + setvbuf(stderr, NULL, _IONBF, 0); CHECKr(pthread_create(&thread, NULL, sock_connect, (void *)argv[2])); diff --git a/regress/usr.sbin/syslogd/ttylog.c b/regress/usr.sbin/syslogd/ttylog.c index a099a545ef3..72c410b1bb8 100644 --- a/regress/usr.sbin/syslogd/ttylog.c +++ b/regress/usr.sbin/syslogd/ttylog.c @@ -68,7 +68,7 @@ main(int argc, char *argv[]) if ((lg = fopen(logfile, "w")) == NULL) err(1, "fopen %s", logfile); - if (setlinebuf(lg) != 0) + if (setvbuf(lg, NULL, _IOLBF, 0) != 0) err(1, "setlinebuf"); memset(&act, 0, sizeof(act)); |