summaryrefslogtreecommitdiffstats
path: root/src/daemon/winsvc.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-25 17:33:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-25 17:34:10 +0000
commit83ba6762cc43d9db581b979bb5e3445669e46cc2 (patch)
tree2e69833b43f791ed253a7a20318b767ebe56cdb8 /src/daemon/winsvc.cc
parentReleasing debian version 1.47.5-1. (diff)
downloadnetdata-83ba6762cc43d9db581b979bb5e3445669e46cc2.tar.xz
netdata-83ba6762cc43d9db581b979bb5e3445669e46cc2.zip
Merging upstream version 2.0.3+dfsg (Closes: #923993, #1042533, #1045145).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/daemon/winsvc.cc')
-rw-r--r--src/daemon/winsvc.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/daemon/winsvc.cc b/src/daemon/winsvc.cc
index 9c5eb49ff..a56f5eb7c 100644
--- a/src/daemon/winsvc.cc
+++ b/src/daemon/winsvc.cc
@@ -4,12 +4,10 @@ extern "C" {
#include "libnetdata/libnetdata.h"
int netdata_main(int argc, char *argv[]);
-void signals_handle(void);
+void nd_process_signals(void);
}
-#include <windows.h>
-
__attribute__((format(printf, 1, 2)))
static void netdata_service_log(const char *fmt, ...)
{
@@ -74,7 +72,7 @@ static HANDLE CreateEventHandle(const char *msg)
if (!h)
{
- netdata_service_log(msg);
+ netdata_service_log("%s", msg);
if (!ReportSvcStatus(SERVICE_STOPPED, GetLastError(), 1000, 0))
{
@@ -219,7 +217,11 @@ static bool update_path() {
int main(int argc, char *argv[])
{
+#if defined(OS_WINDOWS) && defined(RUN_UNDER_CLION)
+ bool tty = true;
+#else
bool tty = isatty(fileno(stdin)) == 1;
+#endif
if (!update_path()) {
return 1;
@@ -231,7 +233,7 @@ int main(int argc, char *argv[])
if (rc != 10)
return rc;
- signals_handle();
+ nd_process_signals();
return 1;
}
else