summaryrefslogtreecommitdiff
path: root/dev-libs/log4cpp/files/log4cpp-1.1-glibc-2.31.patch
blob: 5b927dfe20fa7acc7377a4006d8d611336bbace1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/tests/testDailyRollingFileAppender.cpp b/tests/testDailyRollingFileAppender.cpp
index 9958f41..158c08b 100644
--- a/tests/testDailyRollingFileAppender.cpp
+++ b/tests/testDailyRollingFileAppender.cpp
@@ -22,6 +22,7 @@
 
 #ifndef WIN32    // only available on Win32
 #include <dirent.h>
+#include <sys/time.h>
 #else
 #include <direct.h>  
 #endif
@@ -232,7 +233,8 @@ namespace OnlyManualTesting {
 
 		now += seconds;
 
-		if (stime(&now) == -1) {
+		struct timeval tv = {.tv_sec = now, .tv_usec = 0};
+		if (settimeofday(&tv, NULL) < 0) {
 			std::cerr << "Can not set date. Need admin privileges?" << std::endl;
 			return -1;
 		}