summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2014-11-26 18:34:51 +0000
committermillert <millert@openbsd.org>2014-11-26 18:34:51 +0000
commitb9a887b60dfe0bcd4be9bbd84cc3b6ef94586b9f (patch)
tree69fcd75ffe77994b2e1cb6398698e26414665990
parentMake caretx a perl dependency, not just miniperl (diff)
downloadwireguard-openbsd-b9a887b60dfe0bcd4be9bbd84cc3b6ef94586b9f.tar.xz
wireguard-openbsd-b9a887b60dfe0bcd4be9bbd84cc3b6ef94586b9f.zip
Prefer setvbuf() to setlinebuf() for portability; ok deraadt@
-rw-r--r--bin/ed/main.c4
-rw-r--r--bin/systrace/cradle.c4
-rw-r--r--bin/systrace/systrace.c6
-rw-r--r--sbin/restore/main.c4
-rw-r--r--usr.bin/bc/bc.y4
-rw-r--r--usr.bin/dc/dc.c6
-rw-r--r--usr.bin/gprof/gprof.c4
-rw-r--r--usr.bin/grep/grep.c4
-rw-r--r--usr.bin/last/last.c4
-rw-r--r--usr.bin/leave/leave.c4
-rw-r--r--usr.bin/patch/patch.c6
-rw-r--r--usr.bin/rup/rup.c4
-rw-r--r--usr.bin/rusers/rusers.c4
-rw-r--r--usr.bin/sed/main.c4
-rw-r--r--usr.bin/ssh/sftp.c6
-rw-r--r--usr.bin/ssh/ssh-add.c4
-rw-r--r--usr.bin/tcpbench/tcpbench.c2
-rw-r--r--usr.bin/tmux/log.c4
-rw-r--r--usr.sbin/cron/cron.c8
-rw-r--r--usr.sbin/cron/crontab.c6
-rw-r--r--usr.sbin/map-mbone/mapper.c4
-rw-r--r--usr.sbin/mrinfo/mrinfo.c2
-rw-r--r--usr.sbin/mrouted/defs.h1
-rw-r--r--usr.sbin/mrouted/main.c2
-rw-r--r--usr.sbin/syslogc/syslogc.c6
-rw-r--r--usr.sbin/syslogd/syslogd.c4
-rw-r--r--usr.sbin/tcpdump/tcpdump.c6
-rw-r--r--usr.sbin/trpt/trpt.c4
28 files changed, 56 insertions, 65 deletions
diff --git a/bin/ed/main.c b/bin/ed/main.c
index 442f3be5cc9..7766038da63 100644
--- a/bin/ed/main.c
+++ b/bin/ed/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.40 2014/07/12 02:47:51 guenther Exp $ */
+/* $OpenBSD: main.c,v 1.41 2014/11/26 18:34:51 millert Exp $ */
/* $NetBSD: main.c,v 1.3 1995/03/21 09:04:44 cgd Exp $ */
/* main.c: This file contains the main control and user-interface routines
@@ -141,7 +141,7 @@ top:
if (fstat(STDIN_FILENO, &sb) || !S_ISFIFO(sb.st_mode)) {
if (lseek(STDIN_FILENO, 0, SEEK_CUR)) {
interactive = 1;
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, 0);
}
}
}
diff --git a/bin/systrace/cradle.c b/bin/systrace/cradle.c
index 15fa9495caf..8fe7838afb6 100644
--- a/bin/systrace/cradle.c
+++ b/bin/systrace/cradle.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cradle.c,v 1.7 2014/10/25 03:17:45 lteo Exp $ */
+/* $OpenBSD: cradle.c,v 1.8 2014/11/26 18:34:51 millert Exp $ */
/*
* Copyright (c) 2003 Marius Aamodt Eriksen <marius@monkey.org>
@@ -241,7 +241,7 @@ cradle_start(char *path, char *uipath, char *guipath)
err(1, "dup2");
if (dup2(s, fileno(stdout)) == -1)
err(1, "dup2");
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, 0);
connected = 1;
}
diff --git a/bin/systrace/systrace.c b/bin/systrace/systrace.c
index 7a57f77c7cf..4b03999c544 100644
--- a/bin/systrace/systrace.c
+++ b/bin/systrace/systrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: systrace.c,v 1.60 2014/08/25 07:50:25 doug Exp $ */
+/* $OpenBSD: systrace.c,v 1.61 2014/11/26 18:34:51 millert Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -503,7 +503,7 @@ requestor_start(char *path, int docradle)
err(1, "dup2");
if (dup2(pair[1], fileno(stdout)) == -1)
err(1, "dup2");
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, 0);
close(pair[1]);
}
@@ -524,7 +524,7 @@ requestor_start(char *path, int docradle)
close(pair[0]);
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, 0);
connected = 1;
}
diff --git a/sbin/restore/main.c b/sbin/restore/main.c
index f04083c6969..7224d343947 100644
--- a/sbin/restore/main.c
+++ b/sbin/restore/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.20 2013/11/15 22:20:04 millert Exp $ */
+/* $OpenBSD: main.c,v 1.21 2014/11/26 18:34:51 millert Exp $ */
/* $NetBSD: main.c,v 1.13 1997/07/01 05:37:51 lukem Exp $ */
/*
@@ -157,7 +157,7 @@ main(int argc, char *argv[])
(void)signal(SIGINT, SIG_IGN);
if (signal(SIGTERM, onintr) == SIG_IGN)
(void)signal(SIGTERM, SIG_IGN);
- setlinebuf(stderr);
+ setvbuf(stderr, NULL, _IOLBF, 0);
atexit(cleanup);
diff --git a/usr.bin/bc/bc.y b/usr.bin/bc/bc.y
index f7d5a158559..735f4158090 100644
--- a/usr.bin/bc/bc.y
+++ b/usr.bin/bc/bc.y
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: bc.y,v 1.46 2014/10/14 15:35:18 deraadt Exp $ */
+/* $OpenBSD: bc.y,v 1.47 2014/11/26 18:34:51 millert Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -1095,7 +1095,7 @@ main(int argc, char *argv[])
char *q;
init();
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, 0);
sargv = reallocarray(NULL, argc, sizeof(char *));
if (sargv == NULL)
diff --git a/usr.bin/dc/dc.c b/usr.bin/dc/dc.c
index e131fe95024..eb5d661a51c 100644
--- a/usr.bin/dc/dc.c
+++ b/usr.bin/dc/dc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dc.c,v 1.12 2014/05/20 01:25:23 guenther Exp $ */
+/* $OpenBSD: dc.c,v 1.13 2014/11/26 18:34:51 millert Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -72,8 +72,8 @@ main(int argc, char *argv[])
argv += optind;
init_bmachine(extended_regs);
- (void)setlinebuf(stdout);
- (void)setlinebuf(stderr);
+ (void)setvbuf(stdout, NULL, _IOLBF, 0);
+ (void)setvbuf(stderr, NULL, _IOLBF, 0);
if (argc > 1)
usage();
diff --git a/usr.bin/gprof/gprof.c b/usr.bin/gprof/gprof.c
index d3abfad9c72..c6b1a04f1d5 100644
--- a/usr.bin/gprof/gprof.c
+++ b/usr.bin/gprof/gprof.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gprof.c,v 1.19 2009/10/27 23:59:38 deraadt Exp $ */
+/* $OpenBSD: gprof.c,v 1.20 2014/11/26 18:34:51 millert Exp $ */
/* $NetBSD: gprof.c,v 1.8 1995/04/19 07:15:59 cgd Exp $ */
/*
@@ -72,7 +72,7 @@ main(int argc, char *argv[])
break;
case 'd':
dflag = TRUE;
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, 0);
debug |= atoi( *++argv );
debug |= ANYDEBUG;
# ifdef DEBUG
diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c
index 592573b50ba..89830da8d44 100644
--- a/usr.bin/grep/grep.c
+++ b/usr.bin/grep/grep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grep.c,v 1.46 2014/11/26 17:26:40 millert Exp $ */
+/* $OpenBSD: grep.c,v 1.47 2014/11/26 18:34:51 millert Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -484,7 +484,7 @@ main(int argc, char *argv[])
}
if (lbflag)
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, 0);
if ((argc == 0 || argc == 1) && !Rflag && !Hflag)
hflag = 1;
diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c
index bd1682fc72e..6c2fa1f6f20 100644
--- a/usr.bin/last/last.c
+++ b/usr.bin/last/last.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: last.c,v 1.42 2014/04/22 12:36:36 okan Exp $ */
+/* $OpenBSD: last.c,v 1.43 2014/11/26 18:34:51 millert Exp $ */
/* $NetBSD: last.c,v 1.6 1994/12/24 16:49:02 cgd Exp $ */
/*
@@ -152,7 +152,7 @@ main(int argc, char *argv[])
exit(0);
if (argc) {
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, 0);
for (argv += optind; *argv; ++argv) {
#define COMPATIBILITY
#ifdef COMPATIBILITY
diff --git a/usr.bin/leave/leave.c b/usr.bin/leave/leave.c
index 888b648ba90..9bbf6db9a1d 100644
--- a/usr.bin/leave/leave.c
+++ b/usr.bin/leave/leave.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: leave.c,v 1.13 2013/11/26 13:19:07 deraadt Exp $ */
+/* $OpenBSD: leave.c,v 1.14 2014/11/26 18:34:51 millert Exp $ */
/* $NetBSD: leave.c,v 1.4 1995/07/03 16:50:13 phil Exp $ */
/*
@@ -64,7 +64,7 @@ main(int argc, char *argv[])
int plusnow = 0, twentyfour;
char buf[50];
- if (setlinebuf(stdout) != 0)
+ if (setvbuf(stdout, NULL, _IOLBF, 0) != 0)
errx(1, "Cannot set stdout to line buffered.");
if (argc < 2) {
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index fba035c33bd..dbd97c6a2ac 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: patch.c,v 1.51 2013/11/26 13:19:07 deraadt Exp $ */
+/* $OpenBSD: patch.c,v 1.52 2014/11/26 18:34:51 millert Exp $ */
/*
* patch - a program to apply diffs to original files
@@ -147,8 +147,8 @@ main(int argc, char *argv[])
const char *tmpdir;
char *v;
- setlinebuf(stdout);
- setlinebuf(stderr);
+ setvbuf(stdout, NULL, _IOLBF, 0);
+ setvbuf(stderr, NULL, _IOLBF, 0);
for (i = 0; i < MAXFILEC; i++)
filearg[i] = NULL;
diff --git a/usr.bin/rup/rup.c b/usr.bin/rup/rup.c
index 2820933a68b..3200cfb01a0 100644
--- a/usr.bin/rup/rup.c
+++ b/usr.bin/rup/rup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rup.c,v 1.27 2014/10/08 04:08:13 doug Exp $ */
+/* $OpenBSD: rup.c,v 1.28 2014/11/26 18:34:51 millert Exp $ */
/*-
* Copyright (c) 1993, John Brezak
@@ -314,7 +314,7 @@ main(int argc, char *argv[])
/*NOTREACHED*/
}
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, 0);
if (argc == optind)
allhosts();
diff --git a/usr.bin/rusers/rusers.c b/usr.bin/rusers/rusers.c
index bf07730d6b1..7d991526d4f 100644
--- a/usr.bin/rusers/rusers.c
+++ b/usr.bin/rusers/rusers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rusers.c,v 1.32 2014/10/08 04:08:47 doug Exp $ */
+/* $OpenBSD: rusers.c,v 1.33 2014/11/26 18:34:51 millert Exp $ */
/*
* Copyright (c) 2001, 2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -152,7 +152,7 @@ main(int argc, char **argv)
termwidth = 80;
} else
termwidth = 80;
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, 0);
if (argc == optind) {
if (hflag || iflag || uflag) {
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c
index f50cb7e479f..d7cc3743161 100644
--- a/usr.bin/sed/main.c
+++ b/usr.bin/sed/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.17 2009/10/27 23:59:43 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.18 2014/11/26 18:34:51 millert Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -118,7 +118,7 @@ main(int argc, char *argv[])
nflag = 1;
break;
case 'u':
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, 0);
break;
default:
case '?':
diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c
index 43f8745a88f..12d30d6239b 100644
--- a/usr.bin/ssh/sftp.c
+++ b/usr.bin/ssh/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.167 2014/10/06 00:47:15 djm Exp $ */
+/* $OpenBSD: sftp.c,v 1.168 2014/11/26 18:34:51 millert Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -2059,8 +2059,8 @@ interactive_loop(struct sftp_conn *conn, char *file1, char *file2)
free(dir);
}
- setlinebuf(stdout);
- setlinebuf(infile);
+ setvbuf(stdout, NULL, _IOLBF, 0);
+ setvbuf(infile, NULL, _IOLBF, 0);
interactive = !batchmode && isatty(STDIN_FILENO);
err = 0;
diff --git a/usr.bin/ssh/ssh-add.c b/usr.bin/ssh/ssh-add.c
index 3265072f7a6..fa224afe541 100644
--- a/usr.bin/ssh/ssh-add.c
+++ b/usr.bin/ssh/ssh-add.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-add.c,v 1.113 2014/07/09 14:15:56 benno Exp $ */
+/* $OpenBSD: ssh-add.c,v 1.114 2014/11/26 18:34:51 millert Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -428,7 +428,7 @@ main(int argc, char **argv)
OpenSSL_add_all_algorithms();
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, 0);
/* At first, get a connection to the authentication agent. */
ac = ssh_get_authentication_connection();
diff --git a/usr.bin/tcpbench/tcpbench.c b/usr.bin/tcpbench/tcpbench.c
index 7832bf71fad..a9e83873ed9 100644
--- a/usr.bin/tcpbench/tcpbench.c
+++ b/usr.bin/tcpbench/tcpbench.c
@@ -1003,7 +1003,7 @@ main(int argc, char **argv)
struct statctx *udp_sc = NULL;
/* Init world */
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, 0);
ptb = &tcpbench;
ptb->dummybuf_len = 0;
ptb->Sflag = ptb->sflag = ptb->vflag = 0;
diff --git a/usr.bin/tmux/log.c b/usr.bin/tmux/log.c
index 0680ac4e120..e9708712184 100644
--- a/usr.bin/tmux/log.c
+++ b/usr.bin/tmux/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.11 2014/10/20 23:57:13 nicm Exp $ */
+/* $OpenBSD: log.c,v 1.12 2014/11/26 18:34:51 millert Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -45,7 +45,7 @@ log_open(const char *path)
if (log_file == NULL)
return;
- setlinebuf(log_file);
+ setvbuf(log_file, NULL, _IOLBF, 0);
event_set_log_callback(log_event_cb);
tzset();
diff --git a/usr.sbin/cron/cron.c b/usr.sbin/cron/cron.c
index e3d39778ff7..87654e0de18 100644
--- a/usr.sbin/cron/cron.c
+++ b/usr.sbin/cron/cron.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cron.c,v 1.45 2014/10/29 04:39:02 deraadt Exp $ */
+/* $OpenBSD: cron.c,v 1.46 2014/11/26 18:34:52 millert Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
@@ -72,10 +72,8 @@ main(int argc, char *argv[]) {
setlocale(LC_ALL, "");
-#if defined(BSD)
- setlinebuf(stdout);
- setlinebuf(stderr);
-#endif
+ setvbuf(stdout, NULL, _IOLBF, 0);
+ setvbuf(stderr, NULL, _IOLBF, 0);
NoFork = 0;
parse_args(argc, argv);
diff --git a/usr.sbin/cron/crontab.c b/usr.sbin/cron/crontab.c
index d0993d3e1a2..963b9657124 100644
--- a/usr.sbin/cron/crontab.c
+++ b/usr.sbin/cron/crontab.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crontab.c,v 1.64 2011/08/22 19:32:42 millert Exp $ */
+/* $OpenBSD: crontab.c,v 1.65 2014/11/26 18:34:52 millert Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
@@ -82,9 +82,7 @@ main(int argc, char *argv[]) {
setlocale(LC_ALL, "");
-#if defined(BSD)
- setlinebuf(stderr);
-#endif
+ setvbuf(stderr, NULL, _IOLBF, 0);
parse_args(argc, argv); /* sets many globals, opens a file */
set_cron_cwd();
if (!allowed(RealUser, CRON_ALLOW, CRON_DENY)) {
diff --git a/usr.sbin/map-mbone/mapper.c b/usr.sbin/map-mbone/mapper.c
index a51c0014c8d..e4fe726e699 100644
--- a/usr.sbin/map-mbone/mapper.c
+++ b/usr.sbin/map-mbone/mapper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mapper.c,v 1.20 2011/09/21 18:48:43 jsg Exp $ */
+/* $OpenBSD: mapper.c,v 1.21 2014/11/26 18:34:51 millert Exp $ */
/* $NetBSD: mapper.c,v 1.3 1995/12/10 11:12:04 mycroft Exp $ */
/* Mapper for connections between MRouteD multicast routers.
@@ -810,7 +810,7 @@ int main(int argc, char *argv[])
init_igmp();
setuid(getuid());
- setlinebuf(stderr);
+ setvbuf(stderr, NULL, _IOLBF, 0);
while ((ch = getopt(argc, argv, "d::fgnr:t:")) != -1) {
switch (ch) {
diff --git a/usr.sbin/mrinfo/mrinfo.c b/usr.sbin/mrinfo/mrinfo.c
index 08962772dc3..72da4b033f6 100644
--- a/usr.sbin/mrinfo/mrinfo.c
+++ b/usr.sbin/mrinfo/mrinfo.c
@@ -298,7 +298,7 @@ main(int argc, char *argv[])
if (setresuid(uid, uid, uid) == -1)
err(1, "setresuid");
- setlinebuf(stderr);
+ setvbuf(stderr, NULL, _IOLBF, 0);
while ((ch = getopt(argc, argv, "d::nr:t:")) != -1) {
switch (ch) {
diff --git a/usr.sbin/mrouted/defs.h b/usr.sbin/mrouted/defs.h
index e86cb170e0b..2fb2ea62f83 100644
--- a/usr.sbin/mrouted/defs.h
+++ b/usr.sbin/mrouted/defs.h
@@ -89,7 +89,6 @@ typedef void (*ihfunc_t)(int);
#ifdef SYSV
#define bcopy(a, b, c) memcpy(b, a, c)
#define bzero(s, n) memset((s), 0, (n))
-#define setlinebuf(s) setvbuf(s, NULL, _IOLBF, 0)
#define signal(s,f) sigset(s,f)
#endif
diff --git a/usr.sbin/mrouted/main.c b/usr.sbin/mrouted/main.c
index c182b532c76..b0c83bc1a6a 100644
--- a/usr.sbin/mrouted/main.c
+++ b/usr.sbin/mrouted/main.c
@@ -89,7 +89,7 @@ main(int argc, char *argv[])
fprintf(stderr, "must be root\n");
exit(1);
}
- setlinebuf(stderr);
+ setvbuf(stderr, NULL, _IOLBF, 0);
while ((ch = getopt(argc, argv, "c:d::p")) != -1) {
switch (ch) {
diff --git a/usr.sbin/syslogc/syslogc.c b/usr.sbin/syslogc/syslogc.c
index dedf82b78d9..da49cc69253 100644
--- a/usr.sbin/syslogc/syslogc.c
+++ b/usr.sbin/syslogc/syslogc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syslogc.c,v 1.16 2011/07/12 11:28:31 sthen Exp $ */
+/* $OpenBSD: syslogc.c,v 1.17 2014/11/26 18:34:52 millert Exp $ */
/*
* Copyright (c) 2004 Damien Miller
@@ -154,8 +154,8 @@ main(int argc, char **argv)
err(1, "fwrite");
fflush(ctlf);
- setlinebuf(ctlf);
- setlinebuf(stdout);
+ setvbuf(ctlf, NULL, _IOLBF, 0);
+ setvbuf(stdout, NULL, _IOLBF, 0);
/* Fetch header */
if (fread(&rr, sizeof(rr), 1, ctlf) != 1)
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 98cda562d0a..9548afe08db 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syslogd.c,v 1.130 2014/11/01 12:07:41 bluhm Exp $ */
+/* $OpenBSD: syslogd.c,v 1.131 2014/11/26 18:34:52 millert Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
@@ -347,7 +347,7 @@ main(int argc, char *argv[])
usage();
if (Debug)
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, 0);
if ((fd = nullfd = open(_PATH_DEVNULL, O_RDWR)) == -1) {
logerror("Couldn't open /dev/null");
diff --git a/usr.sbin/tcpdump/tcpdump.c b/usr.sbin/tcpdump/tcpdump.c
index c41a41cfedb..c9210fbce23 100644
--- a/usr.sbin/tcpdump/tcpdump.c
+++ b/usr.sbin/tcpdump/tcpdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcpdump.c,v 1.66 2014/06/30 04:25:11 deraadt Exp $ */
+/* $OpenBSD: tcpdump.c,v 1.67 2014/11/26 18:34:52 millert Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -277,11 +277,7 @@ main(int argc, char **argv)
break;
case 'l':
-#ifdef HAVE_SETLINEBUF
- setlinebuf(stdout);
-#else
setvbuf(stdout, NULL, _IOLBF, 0);
-#endif
break;
case 'L':
++Lflag;
diff --git a/usr.sbin/trpt/trpt.c b/usr.sbin/trpt/trpt.c
index 1329f72bdb0..f8aa4deac02 100644
--- a/usr.sbin/trpt/trpt.c
+++ b/usr.sbin/trpt/trpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trpt.c,v 1.28 2011/07/04 07:06:49 guenther Exp $ */
+/* $OpenBSD: trpt.c,v 1.29 2014/11/26 18:34:52 millert Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -140,7 +140,7 @@ main(int argc, char *argv[])
break;
case 'f':
++follow;
- setlinebuf(stdout);
+ setvbuf(stdout, NULL, _IOLBF, 0);
break;
case 'j':
++jflag;