bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH] Change file_utimes RPC to use a struct timespec and update t


From: Flávio Cruz
Subject: Re: [PATCH] Change file_utimes RPC to use a struct timespec and update the servers to use UTIME_NOW and UTIME_OMIT.
Date: Wed, 7 Oct 2015 21:12:12 +0200

Hi Samuel

Have you see the new patches? Let me know if anything looks wrong.

Cheers
Flavio

On 20 September 2015 at 03:04, Flávio Cruz <flaviocruz@gmail.com> wrote:
Hi Samuel

On Sat, 19 Sep 2015 at 14:22 Samuel Thibault <samuel.thibault@gnu.org> wrote:
Sorry I didn't think about it at first, but inside the fallback on
file_utimes:

Flávio Cruz, le Thu 17 Sep 2015 02:05:33 +0000, a écrit :
> +  if (err == MIG_BAD_ID || err == EOPNOTSUPP)
> +    {
> +      time_value_t atim, mtim;
> +
> +      if (tsp == NULL)
> +        /* Setting the number of microseconds to `-1' tells the
> +           underlying filesystems to use the current time.  */
> +        atim.microseconds = mtim.microseconds = -1;
> +      else
> +        {
> +          TIMESPEC_TO_TIME_VALUE (&atim, &(tsp[0]));
> +          TIMESPEC_TO_TIME_VALUE (&mtim, &(tsp[1]));
> +        }
> +
> +      err = HURD_DPORT_USE (fd, __file_utimes (port, atim, mtim));

We should additionally check for tv_nsec being UTIME_OMIT, and in that case return EOPNOTSUPP.  Otherwise we'd be telling old translators a very odd date.

Gotcha. I'm also checking for UTIME_NOW and then setting the time_value_t microseconds field to -1 so that old translators use the current time.

Flávio
 

Samuel



--
Flávio Cruz / flaviocruz@gmail.com

reply via email to

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