X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fgraph_config.c;h=4f58df0667d0322051cb2067e616038388599b76;hb=f393a5cc0a2a7b0cd1d5b06166966d7af6f9daf5;hp=94dd440edc75d25a9242b6cfc4d0f511ecee2549;hpb=0ab3085f89e64eecd67d3179ea87f0463e918a10;p=collection4.git diff --git a/src/graph_config.c b/src/graph_config.c index 94dd440..4f58df0 100644 --- a/src/graph_config.c +++ b/src/graph_config.c @@ -1,3 +1,26 @@ +/** + * collection4 - graph_config.c + * Copyright (C) 2010 Florian octo Forster + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * Authors: + * Florian octo Forster + **/ + #include #include #include @@ -7,11 +30,14 @@ #include #include "graph_config.h" +#include "graph.h" #include "graph_list.h" #include "oconfig.h" #include "common.h" -#define CONFIG_FILE "/usr/lib/cgi-bin/octo/collection.conf" +#ifndef CONFIGFILE +# define CONFIGFILE "/etc/collection.conf" +#endif time_t last_read_mtime = 0; @@ -39,7 +65,7 @@ static int internal_read_config (void) /* {{{ */ { oconfig_item_t *ci; - ci = oconfig_parse_file (CONFIG_FILE); + ci = oconfig_parse_file (CONFIGFILE); if (ci == NULL) return (-1); @@ -58,7 +84,7 @@ static time_t get_config_mtime (void) /* {{{ */ int status; memset (&statbuf, 0, sizeof (statbuf)); - status = stat (CONFIG_FILE, &statbuf); + status = stat (CONFIGFILE, &statbuf); if (status != 0) return (0);