bug-gnulib
[Top][All Lists]
Advanced

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

Re: gnulib support for st_birthtime (second revision of patch)


From: James Youngman
Subject: Re: gnulib support for st_birthtime (second revision of patch)
Date: Wed, 28 Mar 2007 11:35:46 +0100

On 3/27/07, Paul Eggert <address@hidden> 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

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