From: Dmitry V. Levin Date: Sun, 4 Dec 2016 18:36:31 +0000 (+0000) Subject: Do not allocate memory for line buffered output X-Git-Tag: v4.15~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ecb0a0467453d7ee81439bdf4791e9618387fbc;p=strace Do not allocate memory for line buffered output libc is perfectly capable of allocating memory for its buffers, so let it do its job. * strace.c (init): Do not allocate memory for setvbuf invocation. --- diff --git a/strace.c b/strace.c index f916e325..df1ec3e3 100644 --- a/strace.c +++ b/strace.c @@ -1834,8 +1834,7 @@ init(int argc, char *argv[]) } if (!outfname || outfname[0] == '|' || outfname[0] == '!') { - char *buf = xmalloc(BUFSIZ); - setvbuf(shared_log, buf, _IOLBF, BUFSIZ); + setvbuf(shared_log, NULL, _IOLBF, 0); } if (outfname && argv[0]) { if (!opt_intr)