coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] build: speed up configure for releases


From: Jim Meyering
Subject: Re: [PATCH] build: speed up configure for releases
Date: Tue, 20 Mar 2012 21:18:24 +0100

Jim Meyering wrote:
...
> Subject: [PATCH] tac: avoid malfunction when reading 4GiB or more from a pipe
>
> * src/tac.c (temp_stream): Use fseeko, not fseek, to avoid the
> 4GiB limitation on 32-bit platforms.
> ---
>  src/tac.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/tac.c b/src/tac.c
> index 670b20d..b50382d 100644
> --- 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

Actually, that change is not required, since the offset is 0.
However, I'll go ahead and use the more modern function.
Here's the adjusted log:

>From 5976e78e43e96163d19098a7e9f652b493af292c Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 20 Mar 2012 19:21:01 +0100
Subject: [PATCH] maint: use more modern fseeko, rather than fseek

* 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 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tac.c b/src/tac.c
index 670b20d..b50382d 100644
--- 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"),
--
1.7.10.rc1.23.g16a10



reply via email to

[Prev in Thread] Current Thread [Next in Thread]