X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fvserver.c;h=a730593654bb79c3c0d6b58d69aef812ef2cb838;hb=23ac8e592cd64c424fddce842baea300ff8a3a85;hp=d80717cd3349e6a684e977375604209e7d05b775;hpb=ab6ab6ad6428ba0a0987a20a7d1cfa47d6cc6f8b;p=collectd.git diff --git a/src/vserver.c b/src/vserver.c index d80717cd..a7305936 100644 --- a/src/vserver.c +++ b/src/vserver.c @@ -3,25 +3,31 @@ * Copyright (C) 2006,2007 Sebastian Harl * Copyright (C) 2007-2010 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 - * Free Software Foundation; only version 2 of the license is applicable. + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: * - * 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 - * General Public License for more details. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. * * Authors: * Sebastian Harl - * Florian octo Forster + * Florian octo Forster **/ #include "collectd.h" + #include "common.h" #include "plugin.h" @@ -141,7 +147,7 @@ static int vserver_read (void) if (proc == NULL) { char errbuf[1024]; - ERROR ("vserver plugin: fopen (%s): %s", PROCDIR, + ERROR ("vserver plugin: fopen (%s): %s", PROCDIR, sstrerror (errno, errbuf, sizeof (errbuf))); return (-1); } @@ -180,7 +186,7 @@ static int vserver_read (void) len = ssnprintf (file, sizeof (file), PROCDIR "/%s", dent->d_name); if ((len < 0) || (len >= BUFSIZE)) continue; - + status = stat (file, &statbuf); if (status != 0) { @@ -189,7 +195,7 @@ static int vserver_read (void) file, sstrerror (errno, errbuf, sizeof (errbuf))); continue; } - + if (!S_ISDIR (statbuf.st_mode)) continue; @@ -210,7 +216,7 @@ static int vserver_read (void) { derive_t rx; derive_t tx; - char *type_instance; + const char *type_instance; if (strsplit (buffer, cols, 4) < 4) continue; @@ -260,7 +266,7 @@ static int vserver_read (void) if (2 == n) { - char *type_instance; + const char *type_instance; gauge_t value; if (0 == strcmp (cols[0], "nr_threads:")) @@ -309,8 +315,8 @@ static int vserver_read (void) while ((fh != NULL) && (NULL != fgets (buffer, BUFSIZE, fh))) { - char *type = "vs_memory"; - char *type_instance; + const char *type = "vs_memory"; + const char *type_instance; gauge_t value; if (strsplit (buffer, cols, 2) < 2)