X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fnetwork.c;h=22e911a87b8e4d4fe89d805abc9c9559ce2463c6;hb=44d73d6556833bcfbc4678a01731aafee95c3caf;hp=1ecb9d7467a91561d45371656be55dccc1cb7094;hpb=4c5ba2fe22d95b88d865e74a9487ea176e585dad;p=collectd.git diff --git a/src/network.c b/src/network.c index 1ecb9d74..22e911a8 100644 --- a/src/network.c +++ b/src/network.c @@ -1,6 +1,6 @@ /** * collectd - src/network.c - * Copyright (C) 2006 Florian octo Forster + * Copyright (C) 2005,2006 Florian octo Forster * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -49,11 +49,7 @@ #define BUFF_SIZE 4096 -#ifdef HAVE_LIBRRD extern int operating_mode; -#else -static int operating_mode = MODE_CLIENT; -#endif typedef struct sockent { @@ -218,8 +214,12 @@ int network_create_socket (const char *node, const char *service) DBG ("node = %s, service = %s", node, service); - if (operating_mode == MODE_LOCAL) + if (operating_mode == MODE_LOCAL || operating_mode == MODE_LOG) + { + syslog (LOG_WARNING, "network_create_socket: There is no point opening a socket when you are in mode `%s'.", + operating_mode == MODE_LOCAL ? "Local" : "Log"); return (-1); + } socklist_tail = socklist_head; while ((socklist_tail != NULL) && (socklist_tail->next != NULL)) @@ -516,8 +516,6 @@ int network_send (char *type, char *inst, char *value) if (se->mode != operating_mode) continue; - DBG ("fd = %i", se->fd); - while (1) { status = sendto (se->fd, buf, buflen, 0,