Add substitution code for unavailable function gettimeofday

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13563 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2006-03-09 16:44:11 +00:00
parent 47c9948cd3
commit 04998d5e37
2 changed files with 8 additions and 2 deletions

View File

@ -1,7 +1,8 @@
2006-03-09 Christian Stimming <stimming@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.

View File

@ -1029,7 +1029,12 @@ xaccTransCommitEdit (Transaction *trans)
/* 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;
}