Use gettimeofday instead of ftime that is deprecated or removed.

This solves FTBS on systems where ftime is already removed.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
master
Slávek Banko 1 month ago
parent 9fd41cd9f4
commit 88d74dedf4
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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 {

Loading…
Cancel
Save