X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_cmd_putval.c;h=bf3e2b6f2b9880cf50f6d602bf721ed42c51afb7;hb=9c962b99a3acd77f1d6e2499052b47356819511a;hp=a0d20c5ebe03455dbbbb75d691c1af5bf98586ee;hpb=04f11b9961c4f0a17e87bdc2bd0e4b03cac6c9d1;p=collectd.git diff --git a/src/utils_cmd_putval.c b/src/utils_cmd_putval.c index a0d20c5e..bf3e2b6f 100644 --- a/src/utils_cmd_putval.c +++ b/src/utils_cmd_putval.c @@ -1,25 +1,31 @@ /** - * collectd - src/utils_cms_putval.c + * collectd - src/utils_cmd_putval.c * Copyright (C) 2007-2009 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. * - * Author: - * Florian octo Forster + * Authors: + * Florian octo Forster **/ #include "collectd.h" + #include "common.h" #include "plugin.h" @@ -158,7 +164,7 @@ int handle_putval (FILE *fh, char *buffer) sfree (identifier_copy); vl.values_len = ds->ds_num; - vl.values = (value_t *) malloc (vl.values_len * sizeof (value_t)); + vl.values = malloc (vl.values_len * sizeof (*vl.values)); if (vl.values == NULL) { print_to_socket (fh, "-1 malloc failed.\n"); @@ -213,7 +219,8 @@ int handle_putval (FILE *fh, char *buffer) } /* while (*buffer != 0) */ /* Done parsing the options. */ - print_to_socket (fh, "0 Success: %i %s been dispatched.\n", + if (fh!=stdout) + print_to_socket (fh, "0 Success: %i %s been dispatched.\n", values_submitted, (values_submitted == 1) ? "value has" : "values have");