summaryrefslogtreecommitdiffstats
path: root/cli/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli/cli.c')
-rw-r--r--cli/cli.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/cli/cli.c b/cli/cli.c
index efcf5fce0..288173b1e 100644
--- a/cli/cli.c
+++ b/cli/cli.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
#include "cli.h"
+#include "daemon/pipename.h"
void error_int(int is_collector __maybe_unused, const char *prefix __maybe_unused, const char *file __maybe_unused, const char *function __maybe_unused, const unsigned long line __maybe_unused, const char *fmt, ... ) {
FILE *fp = stderr;
@@ -31,7 +32,7 @@ void *callocz_int(size_t nmemb, size_t size, const char *file __maybe_unused, co
{
void *p = calloc(nmemb, size);
if (unlikely(!p)) {
- error("Cannot allocate %zu bytes of memory.", nmemb * size);
+ netdata_log_error("Cannot allocate %zu bytes of memory.", nmemb * size);
exit(1);
}
return p;
@@ -41,7 +42,7 @@ void *mallocz_int(size_t size, const char *file __maybe_unused, const char *func
{
void *p = malloc(size);
if (unlikely(!p)) {
- error("Cannot allocate %zu bytes of memory.", size);
+ netdata_log_error("Cannot allocate %zu bytes of memory.", size);
exit(1);
}
return p;
@@ -51,7 +52,7 @@ void *reallocz_int(void *ptr, size_t size, const char *file __maybe_unused, cons
{
void *p = realloc(ptr, size);
if (unlikely(!p)) {
- error("Cannot allocate %zu bytes of memory.", size);
+ netdata_log_error("Cannot allocate %zu bytes of memory.", size);
exit(1);
}
return p;
@@ -69,7 +70,7 @@ void freez(void *ptr) {
void *mallocz(size_t size) {
void *p = malloc(size);
if (unlikely(!p)) {
- error("Cannot allocate %zu bytes of memory.", size);
+ netdata_log_error("Cannot allocate %zu bytes of memory.", size);
exit(1);
}
return p;
@@ -78,7 +79,7 @@ void *mallocz(size_t size) {
void *callocz(size_t nmemb, size_t size) {
void *p = calloc(nmemb, size);
if (unlikely(!p)) {
- error("Cannot allocate %zu bytes of memory.", nmemb * size);
+ netdata_log_error("Cannot allocate %zu bytes of memory.", nmemb * size);
exit(1);
}
return p;
@@ -87,7 +88,7 @@ void *callocz(size_t nmemb, size_t size) {
void *reallocz(void *ptr, size_t size) {
void *p = realloc(ptr, size);
if (unlikely(!p)) {
- error("Cannot allocate %zu bytes of memory.", size);
+ netdata_log_error("Cannot allocate %zu bytes of memory.", size);
exit(1);
}
return p;
@@ -288,7 +289,9 @@ int main(int argc, char **argv)
}
req.data = buffer_create(128, NULL);
- uv_pipe_connect(&req, &client_pipe, PIPENAME, connect_cb);
+
+ const char *pipename = daemon_pipename();
+ uv_pipe_connect(&req, &client_pipe, pipename, connect_cb);
uv_run(loop, UV_RUN_DEFAULT);