From 77d3e890e088c4abfef82c2f43fed2241d96a612 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 25 Jun 2008 13:59:28 +0200 Subject: [PATCH] src/rrd_client.h: Renamed the defines to be more consistent with other names. --- src/rrd_client.c | 7 +++---- src/rrd_client.h | 4 ++-- src/rrd_daemon.c | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/rrd_client.c b/src/rrd_client.c index 4449a01..d9a7468 100644 --- a/src/rrd_client.c +++ b/src/rrd_client.c @@ -178,8 +178,7 @@ static int rrdc_connect_unix (const char *path) /* {{{ */ struct sockaddr_un sa; int status; - if (path == NULL) - path = RRDD_SOCK_PATH; + assert (path != NULL); pthread_mutex_lock (&lock); @@ -222,7 +221,7 @@ int rrdc_connect (const char *addr) /* {{{ */ int status; if (addr == NULL) - addr = RRDD_SOCK_PATH; + addr = RRDCACHED_DEFAULT_ADDRESS; if (strncmp ("unix:", addr, strlen ("unix:")) == 0) return (rrdc_connect_unix (addr + strlen ("unix:"))); @@ -246,7 +245,7 @@ int rrdc_connect (const char *addr) /* {{{ */ ai_hints.ai_socktype = SOCK_STREAM; ai_res = NULL; - status = getaddrinfo (addr, DEFAULT_PORT, &ai_hints, &ai_res); + status = getaddrinfo (addr, RRDCACHED_DEFAULT_PORT, &ai_hints, &ai_res); if (status != 0) { pthread_mutex_unlock (&lock); diff --git a/src/rrd_client.h b/src/rrd_client.h index aa80e59..003c4e4 100644 --- a/src/rrd_client.h +++ b/src/rrd_client.h @@ -22,8 +22,8 @@ #ifndef __RRD_CLIENT_H #define __RRD_CLIENT_H 1 -#define RRDD_SOCK_PATH "unix:/tmp/rrdd.sock" -#define DEFAULT_PORT "42217" +#define RRDCACHED_DEFAULT_ADDRESS "unix:/tmp/rrdd.sock" +#define RRDCACHED_DEFAULT_PORT "42217" int rrdc_connect (const char *addr); int rrdc_disconnect (void); diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index 4def10c..9712fcd 100644 --- a/src/rrd_daemon.c +++ b/src/rrd_daemon.c @@ -846,7 +846,7 @@ static int open_listen_socket (const char *addr) /* {{{ */ ai_hints.ai_socktype = SOCK_STREAM; ai_res = NULL; - status = getaddrinfo (addr, DEFAULT_PORT, &ai_hints, &ai_res); + status = getaddrinfo (addr, RRDCACHED_DEFAULT_PORT, &ai_hints, &ai_res); if (status != 0) { RRDD_LOG (LOG_ERR, "open_listen_socket: getaddrinfo(%s) failed: " @@ -934,7 +934,7 @@ static void *listen_thread_main (void *args __attribute__((unused))) /* {{{ */ } if (config_listen_address_list_len < 1) - open_listen_socket (RRDD_SOCK_PATH); + open_listen_socket (RRDCACHED_DEFAULT_ADDRESS); if (listen_fds_num < 1) { -- 2.11.0