X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Futils.c;h=4646a88a6cb44e34e822ad4bfb45c52a07dca2d6;hp=837c828d22b935cb7eb353a60f6d3e93f2dc277d;hb=ae0a823f9f7e1d3800479488a58efc2f92f27d89;hpb=753871f3b4487af73ffe955783dba4f11960c3d3 diff --git a/src/bin/lttng-relayd/utils.c b/src/bin/lttng-relayd/utils.c index 837c828d2..4646a88a6 100644 --- a/src/bin/lttng-relayd/utils.c +++ b/src/bin/lttng-relayd/utils.c @@ -1,19 +1,9 @@ /* - * Copyright (C) 2013 - Julien Desfossez - * David Goulet + * Copyright (C) 2013 Julien Desfossez + * Copyright (C) 2013 David Goulet * - * 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 @@ -33,8 +23,7 @@ static char *create_output_path_auto(const char *path_name) { int ret; char *traces_path = NULL; - char *alloc_path = NULL; - char *default_path; + const char *default_path; default_path = utils_get_home_dir(); if (default_path == NULL) { @@ -42,19 +31,13 @@ static char *create_output_path_auto(const char *path_name) Please specify an output path using -o, --output PATH"); goto exit; } - alloc_path = strdup(default_path); - if (alloc_path == NULL) { - PERROR("Path allocation"); - goto exit; - } ret = asprintf(&traces_path, "%s/" DEFAULT_TRACE_DIR_NAME - "/%s", alloc_path, path_name); + "/%s", default_path, path_name); if (ret < 0) { PERROR("asprintf trace dir name"); goto exit; } exit: - free(alloc_path); return traces_path; }