From 134841a7f3e5516a83732d40a4d42268c901a492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Tue, 31 Jan 2023 01:28:53 +0100 Subject: [PATCH] cmp: Increase buffer size for non-mmap case. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: rpokala Differential Revision: https://reviews.freebsd.org/D38281 --- usr.bin/cmp/special.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/cmp/special.c b/usr.bin/cmp/special.c index 7514c01bd59a..1342f2a86270 100644 --- a/usr.bin/cmp/special.c +++ b/usr.bin/cmp/special.c @@ -65,8 +65,10 @@ c_special(int fd1, const char *file1, off_t skip1, if ((fp1 = fdopen(fd1, "r")) == NULL) err(ERR_EXIT, "%s", file1); + (void)setvbuf(fp1, NULL, _IOFBF, 65536); if ((fp2 = fdopen(fd2, "r")) == NULL) err(ERR_EXIT, "%s", file2); + (void)setvbuf(fp2, NULL, _IOFBF, 65536); dfound = 0; while (skip1--)