X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Futils.cpp;h=ccfc3a92a745f85a68848556f78529f47ebc2a9e;hp=599f7ff819f3cf4855ca9f7b47ae27d6343c0493;hb=HEAD;hpb=ac497a37018f3c253d2e50397294f58d33f7f24f diff --git a/src/bin/lttng-relayd/utils.cpp b/src/bin/lttng-relayd/utils.cpp index 599f7ff81..3d02f6044 100644 --- a/src/bin/lttng-relayd/utils.cpp +++ b/src/bin/lttng-relayd/utils.cpp @@ -7,31 +7,31 @@ */ #define _LGPL_SOURCE +#include "lttng-relayd.hpp" +#include "utils.hpp" + +#include +#include +#include +#include + #include #include #include -#include -#include -#include - -#include "lttng-relayd.h" -#include "utils.h" - static char *create_output_path_auto(const char *path_name) { int ret; - char *traces_path = NULL; + char *traces_path = nullptr; const char *default_path; default_path = utils_get_home_dir(); - if (default_path == NULL) { + if (default_path == nullptr) { ERR("Home path not found.\n \ Please specify an output path using -o, --output PATH"); goto exit; } - ret = asprintf(&traces_path, "%s/" DEFAULT_TRACE_DIR_NAME - "/%s", default_path, path_name); + ret = asprintf(&traces_path, "%s/" DEFAULT_TRACE_DIR_NAME "/%s", default_path, path_name); if (ret < 0) { PERROR("asprintf trace dir name"); goto exit; @@ -43,7 +43,7 @@ exit: static char *create_output_path_noauto(const char *path_name) { int ret; - char *traces_path = NULL; + char *traces_path = nullptr; char *full_path; full_path = utils_expand_path(opt_output_path); @@ -70,7 +70,7 @@ char *create_output_path(const char *path_name) { LTTNG_ASSERT(path_name); - if (opt_output_path == NULL) { + if (opt_output_path == nullptr) { return create_output_path_auto(path_name); } else { return create_output_path_noauto(path_name);