unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* special_mtime
@ 2012-07-04 15:51 Eli Zaretskii
  2012-07-04 17:12 ` special_mtime Paul Eggert
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2012-07-04 15:51 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: special_mtime
  2012-07-04 15:51 special_mtime Eli Zaretskii
@ 2012-07-04 17:12 ` Paul Eggert
  2012-07-04 19:45   ` special_mtime Troels Nielsen
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Eggert @ 2012-07-04 17:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: special_mtime
  2012-07-04 17:12 ` special_mtime Paul Eggert
@ 2012-07-04 19:45   ` Troels Nielsen
  2012-07-05  4:17     ` special_mtime Paul Eggert
  0 siblings, 1 reply; 4+ messages in thread
From: Troels Nielsen @ 2012-07-04 19:45 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Eli Zaretskii, emacs-devel

On Wed, Jul 4, 2012 at 7:12 PM, Paul Eggert <eggert@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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: special_mtime
  2012-07-04 19:45   ` special_mtime Troels Nielsen
@ 2012-07-05  4:17     ` Paul Eggert
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Eggert @ 2012-07-05  4:17 UTC (permalink / raw)
  To: Troels Nielsen; +Cc: emacs-devel

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

Yes, fixed; and thanks for catching that.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-05  4:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-04 15:51 special_mtime Eli Zaretskii
2012-07-04 17:12 ` special_mtime Paul Eggert
2012-07-04 19:45   ` special_mtime Troels Nielsen
2012-07-05  4:17     ` special_mtime Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).