Module: check_mk
Branch: master
Commit: f2d7ce15d761b3487ad55c775f5539a91e121946
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f2d7ce15d761b3…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue Dec 8 13:24:44 2015 +0100
windows agent: made the conversion of file times clearer
---
agents/windows/Makefile | 4 ++--
agents/windows/build_version | 2 +-
agents/windows/check_mk_agent-64.exe | Bin 5939364 -> 858624 bytes
agents/windows/check_mk_agent-64.unversioned.exe | Bin 5939364 -> 858624 bytes
agents/windows/check_mk_agent.cc | 10 ++++++----
agents/windows/check_mk_agent.exe | Bin 4700679 -> 776192 bytes
agents/windows/check_mk_agent.msi | Bin 10972160 -> 1893376 bytes
agents/windows/check_mk_agent.unversioned.exe | Bin 4700679 -> 776192 bytes
agents/windows/install_agent-64.exe | Bin 1401623 -> 393401 bytes
agents/windows/install_agent.exe | Bin 1272825 -> 383537 bytes
10 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/agents/windows/Makefile b/agents/windows/Makefile
index c46113a..f609797 100644
--- a/agents/windows/Makefile
+++ b/agents/windows/Makefile
@@ -27,9 +27,9 @@ SHELL = /bin/bash
VERSION = 1.2.7i4
VERSION_DUMMY = @@@@@CHECK_MK_VERSION@@@@@
WINDRES = i686-w64-mingw32-windres
-#COPTIONS = -s -O2 -Wall -Wformat=2 -Werror -static -static-libgcc -static-libstdc++
-fno-rtti -std=c++11 -DCHECK_MK_VERSION='"$(VERSION_DUMMY)"'
-D__USE_MINGW_ANSI_STDIO
+COPTIONS = -s -O2 -Wall -Wformat=2 -Werror -static -static-libgcc -static-libstdc++
-fno-rtti -std=c++11 -DCHECK_MK_VERSION='"$(VERSION_DUMMY)"'
-D__USE_MINGW_ANSI_STDIO
# for debug builds
-COPTIONS = -O0 -Wall -Werror -static -static-libgcc -static-libstdc++ -fno-rtti
-std=c++11 -ggdb -DCHECK_MK_VERSION='"$(VERSION_DUMMY)"'
-D__USE_MINGW_ANSI_STDIO
+#COPTIONS = -O0 -Wall -Werror -static -static-libgcc -static-libstdc++ -fno-rtti
-std=c++11 -ggdb -DCHECK_MK_VERSION='"$(VERSION_DUMMY)"'
-D__USE_MINGW_ANSI_STDIO
MKDIR = mkdir -p
ifeq ($(shell uname),Linux)
diff --git a/agents/windows/build_version b/agents/windows/build_version
index 2da17b6..e0f6509 100644
--- a/agents/windows/build_version
+++ b/agents/windows/build_version
@@ -1 +1 @@
-677
+695
diff --git a/agents/windows/check_mk_agent-64.exe b/agents/windows/check_mk_agent-64.exe
index 22226f9..7def727 100755
Binary files a/agents/windows/check_mk_agent-64.exe and
b/agents/windows/check_mk_agent-64.exe differ
diff --git a/agents/windows/check_mk_agent-64.unversioned.exe
b/agents/windows/check_mk_agent-64.unversioned.exe
index cbeff7b..07a8fd9 100755
Binary files a/agents/windows/check_mk_agent-64.unversioned.exe and
b/agents/windows/check_mk_agent-64.unversioned.exe differ
diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc
index 1047595..cdeb491 100644
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -284,14 +284,16 @@ double current_time()
return file_time(&filetime);
}
-#define WINDOWS_TICK 10000000
-#define SEC_TO_UNIX_EPOCH 11644473600LL
double file_time(const FILETIME *filetime)
{
+ static const double SEC_TO_UNIX_EPOCH = 11644473600.0;
+ static const double WINDOWS_TICK = 10000000.0;
+
_ULARGE_INTEGER uli;
uli.LowPart = filetime->dwLowDateTime;
uli.HighPart = filetime->dwHighDateTime;
- return double(uli.QuadPart / (double)WINDOWS_TICK - SEC_TO_UNIX_EPOCH);
+
+ return (double(uli.QuadPart) / WINDOWS_TICK) - SEC_TO_UNIX_EPOCH;
}
void char_replace(char what, char into, char *in)
@@ -1898,7 +1900,7 @@ bool output_fileinfo(SOCKET &out, const char *basename,
WIN32_FIND_DATA *data)
if (0 == (data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
output(out, "%s\\%s|%" PRIu64 "|%.0f\n", basename,
- data->cFileName, size, file_time(&data->ftLastWriteTime));
+ data->cFileName, size, file_time(&data->ftLastWriteTime));
return true;
}
return false;
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index 02df19d..f0d3bf6 100755
Binary files a/agents/windows/check_mk_agent.exe and b/agents/windows/check_mk_agent.exe
differ
diff --git a/agents/windows/check_mk_agent.msi b/agents/windows/check_mk_agent.msi
index e8ce49b..101d51a 100755
Binary files a/agents/windows/check_mk_agent.msi and b/agents/windows/check_mk_agent.msi
differ
diff --git a/agents/windows/check_mk_agent.unversioned.exe
b/agents/windows/check_mk_agent.unversioned.exe
index 65aa652..66dc13e 100755
Binary files a/agents/windows/check_mk_agent.unversioned.exe and
b/agents/windows/check_mk_agent.unversioned.exe differ
diff --git a/agents/windows/install_agent-64.exe b/agents/windows/install_agent-64.exe
index 488dc08..3ff18bd 100755
Binary files a/agents/windows/install_agent-64.exe and
b/agents/windows/install_agent-64.exe differ
diff --git a/agents/windows/install_agent.exe b/agents/windows/install_agent.exe
index 1ed96ae..eac862b 100755
Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe
differ