[Gnucash-changes] r13563 - gnucash/trunk - Add substitution code for unavailable function gettimeofday

Christian Stimming cstim at cvs.gnucash.org
Thu Mar 9 11:44:12 EST 2006


Author: cstim
Date: 2006-03-09 11:44:11 -0500 (Thu, 09 Mar 2006)
New Revision: 13563
Trac: http://svn.gnucash.org/trac/changeset/13563

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/engine/Transaction.c
Log:
Add substitution code for unavailable function gettimeofday


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-03-09 16:43:02 UTC (rev 13562)
+++ gnucash/trunk/ChangeLog	2006-03-09 16:44:11 UTC (rev 13563)
@@ -1,7 +1,8 @@
 2006-03-09  Christian Stimming <stimming at tuhh.de>
 
-	* lib/libqof/qof/qoflog.c, gnc-date.c: Add substitution code for
-	unavailable functions gettimeofday and gmtime_r.
+	* lib/libqof/qof/qoflog.c, lib/libqof/qof/gnc-date.c,
+	src/engine/Transaction.c: Add substitution code for unavailable
+	functions gettimeofday and gmtime_r.
 
 	* configure.in, Makefile.am: Replace "ln -sf" by "$(LN_S) -f" for
 	systems that don't have symbolic links available.

Modified: gnucash/trunk/src/engine/Transaction.c
===================================================================
--- gnucash/trunk/src/engine/Transaction.c	2006-03-09 16:43:02 UTC (rev 13562)
+++ gnucash/trunk/src/engine/Transaction.c	2006-03-09 16:44:11 UTC (rev 13563)
@@ -1029,7 +1029,12 @@
    /* Record the time of last modification */
    if (0 == trans->date_entered.tv_sec) {
       struct timeval tv;
+#ifdef HAVE_GETTIMEOFDAY
       gettimeofday (&tv, NULL);
+#else
+      time (&(tv.tv_sec));
+      tv.tv_usec = 0;
+#endif
       trans->date_entered.tv_sec = tv.tv_sec;
       trans->date_entered.tv_nsec = 1000 * tv.tv_usec;
    }



More information about the gnucash-changes mailing list