mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user