On 3/27/07, Paul Eggert <[EMAIL PROTECTED]> wrote:
-  /* Birth time not supported.  */
-  pts->tv_sec = 0;
-  pts->tv_nsec = 0;
-  return 0;                    /* result is not valid */
+  /* Birth time is not supported.  Set tv_sec to avoid undefined behavior.  */
+  t.tv_sec = -1;
+  t.tv_nsec = -1;

This is an implicit change from what *BSD does in this situation; it
normally tries to return (time_t)0 in tv_sec.

To be honest, I don't like the convention of returning ((time_t)0)
myself, since it's a valid timestamp.    Using ((time_t)-1) seems more
sensible to me, by analogy with the result of time(2).

Was the change deliberate?

James.


Reply via email to