OSSP CVS Repository

ossp - Difference in ossp-pkg/js/src/jsfile.c versions 1.7 and 1.8
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/js/src/jsfile.c 1.7 -> 1.8

--- jsfile.c     2006/07/26 07:15:59     1.7
+++ jsfile.c     2006/07/29 09:08:15     1.8
@@ -43,6 +43,10 @@
  */
 #if JS_HAS_FILE_OBJECT
 
+#ifdef OSSP
+#include "../config.h"
+#endif
+
 #include "jsstddef.h"
 
 /* ----------------- Platform-specific includes and defines ----------------- */
@@ -2696,7 +2700,15 @@
             goto out;
         }
 
+#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIME)
         t = (time_t)(info.st_birthtime);
+#elif defined(HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC)
+        t = (time_t)(info.st_birthtimensec / (1000*1000*1000));
+#else
+        /* not really correct, but the only possible fallback on not
+           fully POSIX compliant platforms. */
+        t = (time_t)(info.st_mtime);
+#endif
         tm = localtime(&t);
         *vp = OBJECT_TO_JSVAL(js_NewDateObject(cx, tm->tm_year + 1900,
                                     tm->tm_mon + 1,

CVSTrac 2.0.1