bug-coreutils
[Top][All Lists]
Advanced

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

Re: truncate.c fails to compile on make distcheck


From: Pádraig Brady
Subject: Re: truncate.c fails to compile on make distcheck
Date: Wed, 25 Jun 2008 20:19:56 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

Jim Meyering wrote:
> Here's a tentative patch:
> 
> diff --git a/src/truncate.c b/src/truncate.c
> index 8febd58..52500d2 100644
> --- a/src/truncate.c
> +++ b/src/truncate.c
> @@ -74,10 +74,21 @@ static int
>  parse_len (char const *str, off_t *size)
>  {
>    enum strtol_error e;
> -  /* OFF_T_MAX = INTMAX_MAX */
> -  e = xstrtoimax (str, NULL, 10, size, "EgGkKmMPtTYZ0");
> -  errno = (e == LONGINT_OVERFLOW) ? EOVERFLOW : 0;
> -  return (e == LONGINT_OK) ? 0 : -1;
> +  intmax_t tmp_size;
> +  e = xstrtoimax (str, NULL, 10, &tmp_size, "EgGkKmMPtTYZ0");
> +  if (e == LONGINT_OK
> +      && !(OFF_T_MIN <= tmp_size && tmp_size <= OFF_T_MAX))
> +    e = LONGINT_OVERFLOW;
> +
> +  if (e == LONGINT_OK)
> +    {
> +      errno = 0;
> +      *size = tmp_size;
> +      return 0;
> +    }
> +
> +  errno = (e == LONGINT_OVERFLOW ? EOVERFLOW : 0);
> +  return -1;
>  }
> 
>  static void
> 

I reviewed all uses of off_t in the code and came up with
an almost identical patch, so I'm happy to go with the above.

Signed-off-by: Pádraig Brady <address@hidden>

Micheal there still is something wrong with your system I think.
Did you perhaps compile glibc from scratch and didn't pass
a required configure option for Large File Support?

cheers,
Pádraig.




reply via email to

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