Using LTTNG_HOME environment variable if exists, with fallback to HOME
[lttng-tools.git] / src / bin / lttng / conf.c
index b6632fcb144c052fa0ef4a9652843a074abd64c7..5a0da9d338feb6e3322965602f55386a87f301c2 100644 (file)
@@ -25,6 +25,7 @@
 #include <unistd.h>
 
 #include <common/error.h>
+#include <common/utils.h>
 
 #include "conf.h"
 
@@ -122,14 +123,6 @@ end:
        return ret;
 }
 
-/*
- * Returns the HOME directory path. Caller MUST NOT free(3) the return pointer.
- */
-char *config_get_default_path(void)
-{
-       return getenv("HOME");
-}
-
 /*
  * Destroys directory config and file config.
  */
@@ -161,7 +154,7 @@ end:
  */
 void config_destroy_default(void)
 {
-       char *path = config_get_default_path();
+       char *path = utils_get_home_dir();
        if (path == NULL) {
                return;
        }
@@ -277,7 +270,7 @@ int config_init(char *session_name)
        int ret;
        char *path;
 
-       path = config_get_default_path();
+       path = utils_get_home_dir();
        if (path == NULL) {
                ret = -1;
                goto error;
This page took 0.023881 seconds and 4 git commands to generate.