summaryrefslogtreecommitdiffstats
path: root/daemon/pipename.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-20 04:49:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-20 04:49:55 +0000
commitab1bb5b7f1c3c3a7b240ab7fc8661459ecd7decb (patch)
tree7a900833aad3ccc685712c6c2a7d87576d54f427 /daemon/pipename.c
parentAdding upstream version 1.40.1. (diff)
downloadnetdata-ab1bb5b7f1c3c3a7b240ab7fc8661459ecd7decb.tar.xz
netdata-ab1bb5b7f1c3c3a7b240ab7fc8661459ecd7decb.zip
Adding upstream version 1.41.0.upstream/1.41.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--daemon/pipename.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/daemon/pipename.c b/daemon/pipename.c
new file mode 100644
index 000000000..70b6a25b4
--- /dev/null
+++ b/daemon/pipename.c
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "pipename.h"
+
+#include <stdlib.h>
+
+const char *daemon_pipename(void) {
+ const char *pipename = getenv("NETDATA_PIPENAME");
+ if (pipename)
+ return pipename;
+
+#ifdef _WIN32
+ return "\\\\?\\pipe\\netdata-cli";
+#else
+ return "/tmp/netdata-ipc";
+#endif
+}