X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fcreate.c;h=677c17329070276f6530139f315c1e17409ff0f5;hp=438e88f4cadfeaa18e259d86047f40b9c88db2a8;hb=21a4b05678c20899ad0aa1d3efb565d47d56ecf4;hpb=973ad93ec5c6cc4c373cdae2d3ef8313d0a64cb5 diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c index 438e88f4c..677c17329 100644 --- a/src/bin/lttng/commands/create.c +++ b/src/bin/lttng/commands/create.c @@ -1,19 +1,9 @@ /* - * Copyright (C) 2011 - David Goulet - * Copyright (C) 2019 - Jérémie Galarneau + * Copyright (C) 2011 David Goulet + * Copyright (C) 2019 Jérémie Galarneau * - * 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. + * SPDX-License-Identifier: GPL-2.0-only * - * 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., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #define _LGPL_SOURCE @@ -39,8 +29,7 @@ #include #include #include -#include -#include +#include static char *opt_output_path; static char *opt_session_name; @@ -143,7 +132,6 @@ end: static struct lttng_session_descriptor *create_session_descriptor(void) { - int ret; ssize_t uri_count; enum output_type output_type; struct lttng_uri *uris = NULL; @@ -155,6 +143,7 @@ struct lttng_session_descriptor *create_session_descriptor(void) output_type = OUTPUT_NONE; } else if (opt_output_path) { char *expanded_output_path; + int ret; output_type = OUTPUT_LOCAL; expanded_output_path = utils_expand_path(opt_output_path); @@ -171,6 +160,8 @@ struct lttng_session_descriptor *create_session_descriptor(void) goto end; } } else if (opt_url || opt_ctrl_url) { + int ret; + uri_str1 = opt_ctrl_url ? opt_ctrl_url : opt_url; uri_str2 = opt_data_url; @@ -511,7 +502,7 @@ error: * * Spawn a session daemon by forking and execv. */ -static int spawn_sessiond(char *pathname) +static int spawn_sessiond(const char *pathname) { int ret = 0; pid_t pid; @@ -590,7 +581,7 @@ end: static int launch_sessiond(void) { int ret; - char *pathname = NULL; + const char *pathname = NULL; ret = lttng_session_daemon_alive(); if (ret) { @@ -637,6 +628,7 @@ end: return ret; } +static int validate_url_option_combination(void) { int ret = 0;