bug-coreutils
[Top][All Lists]
Advanced

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

Re: int->bool etc. cleanup for coreutils cp, mv, install, rm


From: Dmitry V. Levin
Subject: Re: int->bool etc. cleanup for coreutils cp, mv, install, rm
Date: Tue, 10 Aug 2004 21:45:45 +0400

Hi,

On Fri, Jul 30, 2004 at 01:12:13AM -0700, Paul Eggert wrote:
> I installed this patch to use bool (and size_t) when possible, instead
> of int.  I don't think it fixes any bugs.

I'm afraid it introduces new bugs:

[...]
>  /* Set the timestamps of file TO to match those of file FROM.
> -   Return 0 if successful, 1 if not. */
> +   Return true if successful.  */
>  
> -static int
> +static bool
>  change_timestamps (const char *from, const char *to)
>  {
>    struct stat stb;
> @@ -554,7 +546,7 @@ change_timestamps (const char *from, con
>    if (stat (from, &stb))
>      {
>        error (0, errno, _("cannot obtain time stamps for %s"), quote (from));
> -      return 1;
> +      return true;
>      }
>  
>    timespec[0].tv_sec = stb.st_atime;
> @@ -564,9 +556,9 @@ change_timestamps (const char *from, con
>    if (utimens (to, timespec))
>      {
>        error (0, errno, _("cannot set time stamps for %s"), quote (to));
> -      return 1;
> +      return true;
>      }
> -  return 0;
> +  return false;
>  }
>  

I had to apply attached patch to make "install -p" work again.


-- 
ldv

Attachment: coreutils-5.3.0-alt-install-change_timestamps.patch
Description: Text document

Attachment: pgpaeMdzl430c.pgp
Description: PGP signature


reply via email to

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