X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fcalibrate.c;h=a14570eea5e3341b173595ff91c07323e66d2cbb;hp=a60cadfa042a629eee9d97f1c4c1615a889e6656;hb=d14d33bf091e72b23b1f90ea18a0a01bed098b76;hpb=1c8d13c8a4111fcfd4cc00c335d47506ab98bb33 diff --git a/src/bin/lttng/commands/calibrate.c b/src/bin/lttng/commands/calibrate.c index a60cadfa0..a14570eea 100644 --- a/src/bin/lttng/commands/calibrate.c +++ b/src/bin/lttng/commands/calibrate.c @@ -2,19 +2,18 @@ * Copyright (C) 2011 - David Goulet * Copyright (C) 2011 - Mathieu Desnoyers * - * 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. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2 only, + * as published by the Free Software Foundation. * * 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. * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #define _GNU_SOURCE @@ -127,6 +126,9 @@ static int calibrate_lttng(void) struct lttng_domain dom; struct lttng_calibrate calibrate; + memset(&dom, 0, sizeof(dom)); + memset(&calibrate, 0, sizeof(calibrate)); + /* Create lttng domain */ if (opt_kernel) { dom.type = LTTNG_DOMAIN_KERNEL; @@ -156,7 +158,6 @@ static int calibrate_lttng(void) calibrate.type = LTTNG_CALIBRATE_FUNCTION; ret = lttng_calibrate(handle, &calibrate); if (ret < 0) { - ret = CMD_ERROR; goto error; } MSG("%s calibration done", opt_kernel ? "Kernel" : "UST"); @@ -187,7 +188,7 @@ error: */ int cmd_calibrate(int argc, const char **argv) { - int opt, ret; + int opt, ret = CMD_SUCCESS; static poptContext pc; pc = poptGetContext(NULL, argc, argv, long_options, 0); @@ -200,7 +201,6 @@ int cmd_calibrate(int argc, const char **argv) switch (opt) { case OPT_HELP: usage(stdout); - ret = CMD_SUCCESS; goto end; case OPT_TRACEPOINT: ret = CMD_UNDEFINED; @@ -225,7 +225,6 @@ int cmd_calibrate(int argc, const char **argv) break; case OPT_LIST_OPTIONS: list_cmd_options(stdout, long_options); - ret = CMD_SUCCESS; goto end; default: usage(stderr); @@ -237,5 +236,6 @@ int cmd_calibrate(int argc, const char **argv) ret = calibrate_lttng(); end: + poptFreeContext(pc); return ret; }