Module: check_mk
Branch: master
Commit: 8fd8ad3ad05c43351bd4a034b7ad48b51c06f64b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8fd8ad3ad05c43…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Jun 26 08:42:09 2017 +0200
Fixed formatting of the Windows agent source code.
Change-Id: Iaf9c8e39652237c05bf1379e5805eae83f061f0f
---
agents/windows/EventLogVista.cc | 12 +++++++-----
agents/windows/ExternalCmd.cc | 23 +++++++++++------------
agents/windows/build_version | 2 +-
agents/windows/check_mk_agent-64.exe | Bin 1339904 -> 1369600 bytes
agents/windows/check_mk_agent-64.unstripped.exe | Bin 15823277 -> 17208624 bytes
agents/windows/check_mk_agent-64.unversioned.exe | Bin 1339904 -> 1369600 bytes
agents/windows/check_mk_agent.cc | 2 --
agents/windows/check_mk_agent.exe | Bin 1317888 -> 1351680 bytes
agents/windows/check_mk_agent.msi | Bin 2927616 -> 2992128 bytes
agents/windows/check_mk_agent.unstripped.exe | Bin 13681693 -> 15041453 bytes
agents/windows/check_mk_agent.unversioned.exe | Bin 1317888 -> 1351680 bytes
agents/windows/crash.exe | Bin 101624 -> 358864 bytes
agents/windows/install_agent-64.exe | Bin 591860 -> 603781 bytes
agents/windows/install_agent.exe | Bin 589484 -> 603278 bytes
agents/windows/nowin.exe | Bin 103760 -> 361000 bytes
15 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/agents/windows/EventLogVista.cc b/agents/windows/EventLogVista.cc
index 1d21879..a0ebde3 100644
--- a/agents/windows/EventLogVista.cc
+++ b/agents/windows/EventLogVista.cc
@@ -177,8 +177,9 @@ public:
std::wstring result;
result.resize(128);
auto publisher_meta = std::make_unique<ManagedEventHandle>(
- *_evt, _evt->openPublisherMetadata(nullptr, source().c_str(),
- nullptr, 0, 0));
+ *_evt,
+ _evt->openPublisherMetadata(nullptr, source().c_str(), nullptr, 0,
+ 0));
if (publisher_meta->get_handle() != nullptr) {
for (;;) {
DWORD required;
@@ -320,9 +321,10 @@ uint64_t EventLogVista::seek(uint64_t record_id) {
*_evt, evt().createBookmark(bookmarkXml.c_str()));
_handle = std::make_unique<ManagedEventHandle>(
- *_evt, evt().subscribe(nullptr, _signal->get_handle(), _path.c_str(),
- L"*", bookmark->get_handle(), nullptr,
nullptr,
- EvtSubscribeStartAfterBookmark));
+ *_evt,
+ evt().subscribe(nullptr, _signal->get_handle(), _path.c_str(),
L"*",
+ bookmark->get_handle(), nullptr, nullptr,
+ EvtSubscribeStartAfterBookmark));
if (_handle->get_handle() == nullptr) {
throw win_exception(
diff --git a/agents/windows/ExternalCmd.cc b/agents/windows/ExternalCmd.cc
index 3d12242..a882dab 100644
--- a/agents/windows/ExternalCmd.cc
+++ b/agents/windows/ExternalCmd.cc
@@ -31,14 +31,11 @@
extern bool with_stderr;
extern HANDLE g_workers_job_object;
-
-bool ends_with(std::string const & value, std::string const & ending)
-{
+bool ends_with(std::string const &value, std::string const &ending) {
if (ending.size() > value.size()) return false;
return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
}
-
ExternalCmd::ExternalCmd(const char *cmdline) {
SECURITY_DESCRIPTOR security_descriptor;
SECURITY_ATTRIBUTES security_attributes;
@@ -56,13 +53,14 @@ ExternalCmd::ExternalCmd(const char *cmdline) {
// child process needs to be able to inherit the pipe handles
security_attributes.bInheritHandle = true;
- if (!CreatePipe(_stdout.ptr(), _script_stdout.ptr(), &security_attributes, 0)) {
+ if (!CreatePipe(_stdout.ptr(), _script_stdout.ptr(), &security_attributes,
+ 0)) {
throw win_exception("failed to create pipe");
}
-
if (with_stderr) {
- if (!CreatePipe(_stderr.ptr(), _script_stderr.ptr(), &security_attributes,
0)) {
+ if (!CreatePipe(_stderr.ptr(), _script_stderr.ptr(),
+ &security_attributes, 0)) {
throw win_exception("failed to create pipe");
}
}
@@ -75,14 +73,16 @@ ExternalCmd::ExternalCmd(const char *cmdline) {
si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
si.hStdOutput = (HANDLE)_script_stdout;
- si.hStdError = with_stderr ? (HANDLE)_script_stdout : (HANDLE)_script_stderr;
+ si.hStdError =
+ with_stderr ? (HANDLE)_script_stdout : (HANDLE)_script_stderr;
PROCESS_INFORMATION pi;
ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
std::unique_ptr<char[], decltype(free) *> cmdline_buf(strdup(cmdline),
free);
- bool detach_process = ends_with(std::string(cmdline),
std::string("cmk-update-agent.exe\""));
+ bool detach_process =
+ ends_with(std::string(cmdline),
std::string("cmk-update-agent.exe\""));
DWORD dwCreationFlags = CREATE_NEW_CONSOLE;
if (detach_process) {
@@ -102,8 +102,8 @@ ExternalCmd::ExternalCmd(const char *cmdline) {
// Whenever the process ends all of its childs will terminate, too
_job_object = CreateJobObject(nullptr, nullptr);
if (!detach_process) {
- AssignProcessToJobObject(_job_object, pi.hProcess);
- AssignProcessToJobObject(g_workers_job_object, pi.hProcess);
+ AssignProcessToJobObject(_job_object, pi.hProcess);
+ AssignProcessToJobObject(g_workers_job_object, pi.hProcess);
}
}
@@ -115,7 +115,6 @@ ExternalCmd::~ExternalCmd() {
::CloseHandle(_process);
}
-
void ExternalCmd::terminateJob(DWORD exit_code) {
::TerminateJobObject(_job_object, exit_code);
::CloseHandle(_job_object);
diff --git a/agents/windows/build_version b/agents/windows/build_version
index c98e88a..3c6eb2a 100644
--- a/agents/windows/build_version
+++ b/agents/windows/build_version
@@ -1 +1 @@
-2713
+2715
diff --git a/agents/windows/check_mk_agent-64.exe b/agents/windows/check_mk_agent-64.exe
index a1750d6..0860858 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.unstripped.exe
b/agents/windows/check_mk_agent-64.unstripped.exe
index d0c42ee..e4a9ed5 100755
Binary files a/agents/windows/check_mk_agent-64.unstripped.exe and
b/agents/windows/check_mk_agent-64.unstripped.exe differ
diff --git a/agents/windows/check_mk_agent-64.unversioned.exe
b/agents/windows/check_mk_agent-64.unversioned.exe
index 32229f9..ddf6f3a 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 5654756..bbce919 100644
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -48,12 +48,10 @@
#include <locale.h>
#include <shellapi.h>
#include <stdarg.h>
-#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
-#include <sys/types.h>
#include <time.h>
#include <tlhelp32.h> // list of processes
#include <unistd.h>
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index 5b0c4de..fe6d16f 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 b4de316..25fd387 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.unstripped.exe
b/agents/windows/check_mk_agent.unstripped.exe
index 0b43306..19d5b5e 100755
Binary files a/agents/windows/check_mk_agent.unstripped.exe and
b/agents/windows/check_mk_agent.unstripped.exe differ
diff --git a/agents/windows/check_mk_agent.unversioned.exe
b/agents/windows/check_mk_agent.unversioned.exe
index e77dcc3..06ce1f3 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/crash.exe b/agents/windows/crash.exe
index 7a9e64a..6fec41a 100755
Binary files a/agents/windows/crash.exe and b/agents/windows/crash.exe differ
diff --git a/agents/windows/install_agent-64.exe b/agents/windows/install_agent-64.exe
index 4210301..8a7134b 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 867cf5d..6f923a9 100755
Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe
differ
diff --git a/agents/windows/nowin.exe b/agents/windows/nowin.exe
index 856afb5..8139799 100755
Binary files a/agents/windows/nowin.exe and b/agents/windows/nowin.exe differ