]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
fold: fix fadvise hint
authorAndreas Schwab <schwab@linux-m68k.org>
Sat, 16 Oct 2010 11:32:04 +0000 (13:32 +0200)
committerJim Meyering <meyering@redhat.com>
Sat, 16 Oct 2010 11:32:04 +0000 (13:32 +0200)
* src/fold.c (fold_file): Apply fadvise to istream, not stdin.
This bug would have inhibited the fadvise optimization when not
reading from standard input.

src/fold.c

index d5858568cab0007cb29b9a735ef373ce0bda37a2..4da834b17febde4e481294ddc12338ffe0a577e8 100644 (file)
@@ -143,7 +143,7 @@ fold_file (char const *filename, size_t width)
       return false;
     }
 
-  fadvise (stdin, FADVISE_SEQUENTIAL);
+  fadvise (istream, FADVISE_SEQUENTIAL);
 
   while ((c = getc (istream)) != EOF)
     {