b629361c17
linux. fix PR pkg/51684
29 lines
767 B
Text
29 lines
767 B
Text
$NetBSD: patch-ab,v 1.4 2016/12/03 09:06:37 maya Exp $
|
|
|
|
Avoid ancient function that needs libcompat.
|
|
include sys/time.h for gettimeofday (needed by linux)
|
|
|
|
--- zlibrary/core/src/unix/time/ZLUnixTime.cpp.orig 2012-11-30 12:41:25.000000000 +0000
|
|
+++ zlibrary/core/src/unix/time/ZLUnixTime.cpp
|
|
@@ -17,17 +17,17 @@
|
|
* 02110-1301, USA.
|
|
*/
|
|
|
|
-#include <sys/timeb.h>
|
|
#include <time.h>
|
|
+#include <sys/time.h>
|
|
|
|
#include <ZLTime.h>
|
|
|
|
#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(timeB.tv_sec, timeB.tv_usec/1000);
|
|
}
|
|
|
|
short ZLUnixTimeManager::hoursBySeconds(long seconds) const {
|