maint: use more modern fseeko, rather than fseek
authorJim Meyering <meyering@redhat.com>
Tue, 20 Mar 2012 18:21:01 +0000 (19:21 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 21 Mar 2012 21:00:17 +0000 (22:00 +0100)
* src/tac.c (temp_stream): Use fseeko, not fseek, on principle:
use the more modern interface.  In general it is better to avoid
fseek due to its ABI-imposed 4GiB limit on the "offset", here its
use was fine because the offset was always 0.  Using fseeko also
has the advantage of not triggering a GNULIB_POSIXCHECK warning.
Reported by Eric Blake in
http://thread.gmane.org/gmane.comp.gnu.coreutils.general/2426/focus=2489

src/tac.c

index 670b20d..b50382d 100644 (file)
--- a/src/tac.c
+++ b/src/tac.c
@@ -470,7 +470,7 @@ temp_stream (FILE **fp, char **file_name)
     }
   else
     {
-      if (fseek (tmp_fp, 0, SEEK_SET) < 0
+      if (fseeko (tmp_fp, 0, SEEK_SET) < 0
           || ftruncate (fileno (tmp_fp), 0) < 0)
         {
           error (0, errno, _("failed to rewind stream for %s"),