X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fapcups.c;h=b4bc0997e6c3e7d309d13e23225edef31ca7f465;hb=74754182f90bf6ea2d2df5f1d0c93dfcf233c1a4;hp=718061ae36e693a9125325f3403da98f25be2316;hpb=155102256542b6dab3261cd2d6dfb000354de425;p=collectd.git diff --git a/src/apcups.c b/src/apcups.c index 718061ae..b4bc0997 100644 --- a/src/apcups.c +++ b/src/apcups.c @@ -125,7 +125,7 @@ static int net_open (char const *node, char const *service) if (status != 0) { char errbuf[1024]; - INFO ("getaddrinfo failed: %s", + INFO ("apcups plugin: getaddrinfo failed: %s", (status == EAI_SYSTEM) ? sstrerror (errno, errbuf, sizeof (errbuf)) : gai_strerror (status)); @@ -144,7 +144,7 @@ static int net_open (char const *node, char const *service) if (sd < 0) { - DEBUG ("Unable to open a socket"); + DEBUG ("apcups plugin: Unable to open a socket"); freeaddrinfo (ai_return); return (-1); } @@ -156,13 +156,13 @@ static int net_open (char const *node, char const *service) if (status != 0) /* `connect(2)' failed */ { char errbuf[1024]; - INFO ("connect failed: %s", + INFO ("apcups plugin: connect failed: %s", sstrerror (errno, errbuf, sizeof (errbuf))); close (sd); return (-1); } - DEBUG ("Done opening a socket %i", sd); + DEBUG ("apcups plugin: Done opening a socket %i", sd); return (sd); } /* int net_open */ @@ -220,7 +220,7 @@ static int net_recv (int *sockfd, char *buf, int buflen) * Returns zero on success * Returns non-zero on error */ -static int net_send (int *sockfd, char *buff, int len) +static int net_send (int *sockfd, const char *buff, int len) { uint16_t packet_size; @@ -401,7 +401,7 @@ static int apcups_config (oconfig_item_t *ci) return (0); } /* int apcups_config */ -static void apc_submit_generic (char *type, char *type_inst, double value) +static void apc_submit_generic (const char *type, const char *type_inst, double value) { value_t values[1]; value_list_t vl = VALUE_LIST_INIT; @@ -455,7 +455,7 @@ static int apcups_read (void) */ if (status != 0) { - DEBUG ("apc_query_server (%s, %s) = %i", + DEBUG ("apcups plugin: apc_query_server (%s, %s) = %i", (conf_node == NULL) ? APCUPS_DEFAULT_NODE : conf_node, (conf_service == NULL) ? APCUPS_DEFAULT_SERVICE : conf_service, status);