return (buffer_add_string (temp, buffer_ret, buffer_size_ret));
} /* }}} int buffer_add_value */
-static int rrdd_connect_unix (const char *path) /* {{{ */
+static int rrdc_connect_unix (const char *path) /* {{{ */
{
struct sockaddr_un sa;
int status;
pthread_mutex_unlock (&lock);
return (0);
-} /* }}} int rrdd_connect_unix */
+} /* }}} int rrdc_connect_unix */
-int rrdd_connect (const char *addr) /* {{{ */
+int rrdc_connect (const char *addr) /* {{{ */
{
struct addrinfo ai_hints;
struct addrinfo *ai_res;
addr = RRDD_SOCK_PATH;
if (strncmp ("unix:", addr, strlen ("unix:")) == 0)
- return (rrdd_connect_unix (addr + strlen ("unix:")));
+ return (rrdc_connect_unix (addr + strlen ("unix:")));
else if (addr[0] == '/')
- return (rrdd_connect_unix (addr));
+ return (rrdc_connect_unix (addr));
pthread_mutex_lock (&lock);
pthread_mutex_unlock (&lock);
return (status);
-} /* }}} int rrdd_connect */
+} /* }}} int rrdc_connect */
-int rrdd_disconnect (void) /* {{{ */
+int rrdc_disconnect (void) /* {{{ */
{
int status;
pthread_mutex_unlock (&lock);
return (status);
-} /* }}} int rrdd_disconnect */
+} /* }}} int rrdc_disconnect */
-int rrdd_update (const char *filename, int values_num, /* {{{ */
+int rrdc_update (const char *filename, int values_num, /* {{{ */
const char * const *values)
{
char buffer[4096];
#define RRDD_SOCK_PATH "unix:/tmp/rrdd.sock"
#define DEFAULT_PORT "42217"
-int rrdd_connect (const char *addr);
-int rrdd_disconnect (void);
+int rrdc_connect (const char *addr);
+int rrdc_disconnect (void);
-int rrdd_update (const char *filename, int values_num,
+int rrdc_update (const char *filename, int values_num,
const char * const *values);
#endif /* __RRD_CLIENT_H */
{
int status;
- status = rrdd_connect ((addr != NULL) ? addr : RRDD_SOCK_PATH);
+ status = rrdc_connect ((addr != NULL) ? addr : RRDD_SOCK_PATH);
if (status != 0)
{
if (!silent)
return (status);
}
- status = rrdd_update (file, values_num, values);
+ status = rrdc_update (file, values_num, values);
if (status != 0)
{
if (!silent)
? "Internal error"
: rrd_strerror (status));
}
- rrdd_disconnect ();
+ rrdc_disconnect ();
return (status);
}
- rrdd_disconnect ();
+ rrdc_disconnect ();
return (0);
} /* int send_values_to_daemon */