X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fconf.cpp;fp=src%2Fbin%2Flttng%2Fconf.cpp;h=44630b681135843eab58022294c89479dc003d19;hp=33550eb3778fe5fb636c0700618b153804f84057;hb=28ab034a2c3582d07d3423d2d746731f87d3969f;hpb=52e345b9ac912d033c2a2c25a170a01cf209839d diff --git a/src/bin/lttng/conf.cpp b/src/bin/lttng/conf.cpp index 33550eb37..44630b681 100644 --- a/src/bin/lttng/conf.cpp +++ b/src/bin/lttng/conf.cpp @@ -6,6 +6,12 @@ */ #define _LGPL_SOURCE +#include "conf.hpp" + +#include +#include +#include + #include #include #include @@ -14,12 +20,6 @@ #include #include -#include -#include -#include - -#include "conf.hpp" - /* * Returns the path with '/CONFIG_FILENAME' added to it; * path will be NULL if an error occurs. @@ -167,15 +167,14 @@ int config_exists(const char *path) return S_ISREG(info.st_mode) || S_ISDIR(info.st_mode); } -static -int _config_read_session_name(const char *path, char **name) +static int _config_read_session_name(const char *path, char **name) { int ret = 0; FILE *fp; char var[NAME_MAX], *session_name; #if (NAME_MAX == 255) -#define NAME_MAX_SCANF_IS_A_BROKEN_API "254" +#define NAME_MAX_SCANF_IS_A_BROKEN_API "254" #endif session_name = calloc(NAME_MAX); @@ -192,9 +191,11 @@ int _config_read_session_name(const char *path, char **name) } while (!feof(fp)) { - if ((ret = fscanf(fp, "%" NAME_MAX_SCANF_IS_A_BROKEN_API - "[^'=']=%" NAME_MAX_SCANF_IS_A_BROKEN_API "s\n", - var, session_name)) != 2) { + if ((ret = fscanf(fp, + "%" NAME_MAX_SCANF_IS_A_BROKEN_API + "[^'=']=%" NAME_MAX_SCANF_IS_A_BROKEN_API "s\n", + var, + session_name)) != 2) { if (ret == -1) { ERR("Missing session=NAME in config file."); goto error_close;