summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2024-10-13 14:38:25 +0200
committerSlávek Banko <[email protected]>2024-10-13 14:54:28 +0200
commit4b57a188fbd4ac2439f2a141475222c8d68d67ea (patch)
tree7bdbfd9d9f7a5be3a66a6407bd2b1e294b9f4aa6
parent642140ab85ce55b000b67e7c659e1dab0b6542cc (diff)
downloadtde-ebook-reader-4b57a188fbd4ac2439f2a141475222c8d68d67ea.tar.gz
tde-ebook-reader-4b57a188fbd4ac2439f2a141475222c8d68d67ea.zip
Use gettimeofday instead of ftime that is deprecated or removed.r14.1.3r14.1.x
This solves FTBS on systems where ftime is already removed. Signed-off-by: Slávek Banko <[email protected]> (cherry picked from commit 88d74dedf45e6f7f2d20b60930fbc1353d60d94c)
-rw-r--r--zlibrary/core/src/unix/time/ZLUnixTime.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/zlibrary/core/src/unix/time/ZLUnixTime.cpp b/zlibrary/core/src/unix/time/ZLUnixTime.cpp
index dd23ae5..959fde2 100644
--- a/zlibrary/core/src/unix/time/ZLUnixTime.cpp
+++ b/zlibrary/core/src/unix/time/ZLUnixTime.cpp
@@ -17,7 +17,7 @@
* 02110-1301, USA.
*/
-#include <sys/timeb.h>
+#include <sys/time.h>
#include <time.h>
#include <ZLTime.h>
@@ -25,9 +25,9 @@
#include "ZLUnixTime.h"
ZLTime ZLUnixTimeManager::currentTime() const {
- struct timeb timeB;
- ftime(&timeB);
- return ZLTime((long)timeB.time, timeB.millitm);
+ struct timeval timeB;
+ gettimeofday(&timeB,NULL);
+ return ZLTime((long)timeB.tv_sec, timeB.tv_usec/1000);
}
short ZLUnixTimeManager::hoursBySeconds(long seconds) const {