Eli Zaretskii | 4 Jul 2012 17:51
Picon

special_mtime

This function's name is too general, and thus doesn't tell anything
about its return value.  Also, the "mtime" part doesn't seem to be
relevant, since the function can likewise set st_atime or whatever.

How about a better name that somehow hints at what the function does,
and thus avoids the need to look up its source?

TIA

Paul Eggert | 4 Jul 2012 19:12
Favicon

Re: special_mtime

On 07/04/2012 08:51 AM, Eli Zaretskii wrote:
> How about a better name that somehow hints at what the function does,

Thanks for catching that.  I changed it to time_error_value.
If you think of a better name please feel free to change it again.

Troels Nielsen | 4 Jul 2012 21:45
Picon

Re: special_mtime

On Wed, Jul 4, 2012 at 7:12 PM, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> On 07/04/2012 08:51 AM, Eli Zaretskii wrote:
>> How about a better name that somehow hints at what the function does,
>
> Thanks for catching that.  I changed it to time_error_value.
> If you think of a better name please feel free to change it again.
>

Hi Paul

+/* Return a special mtime value indicating the error number ERRNUM.  */
+static EMACS_TIME
+special_mtime (int errnum)
+{
+  EMACS_TIME t;
+  int ns = (errno == ENOENT || errno == EACCES || errno == ENOTDIR
+           ? NONEXISTENT_MODTIME_NSECS
+           : UNKNOWN_MODTIME_NSECS);
+  EMACS_SET_SECS_NSECS (t, 0, ns);
+  return t;
+}

Shouldn't errno be errnum here?

Regards
Troels Nielsen

Paul Eggert | 5 Jul 2012 06:17
Favicon

Re: special_mtime

On 07/04/2012 12:45 PM, Troels Nielsen wrote:
> Shouldn't errno be errnum here?

Yes, fixed; and thanks for catching that.


Gmane