X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Flttng-ctl.c;h=1b9f3a8ab99a95d54e6ffcd6b8465092dfe4da17;hp=6c8ad411a3ab7de446f8a8bdda20c4b552dad6b6;hb=feb0f3e5900ff58202ea0c3f227de3c1b8291952;hpb=0c7bcad5eaa11b368460759fc87f949e8c56b98f diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 6c8ad411a..1b9f3a8ab 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include "filter/filter-ast.h" @@ -485,7 +486,7 @@ static int set_session_daemon_path(void) * With GNU C >= 2.1, snprintf returns the required size (excluding closing null) */ ret = snprintf(sessiond_sock_path, sizeof(sessiond_sock_path), - DEFAULT_HOME_CLIENT_UNIX_SOCK, getenv("HOME")); + DEFAULT_HOME_CLIENT_UNIX_SOCK, utils_get_home_dir()); if ((ret < 0) || (ret >= sizeof(sessiond_sock_path))) { goto error; } @@ -1543,7 +1544,7 @@ static int set_health_socket_path(void) * With GNU C < 2.1, snprintf returns -1 if the target buffer is too small; * With GNU C >= 2.1, snprintf returns the required size (excluding closing null) */ - home = getenv("HOME"); + home = utils_get_home_dir(); if (home == NULL) { /* Fallback in /tmp .. */ home = "/tmp";