Fix: Java agent should use LTTNG_HOME
[lttng-ust.git] / liblttng-ust-java-agent / java / lttng-ust-agent-common / org / lttng / ust / agent / client / LttngTcpSessiondClient.java
index 6177feac7a849cefb44e959197e30894b295f529..e9b52f1de9bdd91bec480fe3abd86820936801e6 100644 (file)
@@ -179,7 +179,16 @@ public class LttngTcpSessiondClient implements Runnable {
        }
 
        private static String getHomePath() {
-               return System.getProperty("user.home");
+               /*
+                * The environment variable LTTNG_HOME overrides HOME if
+                * defined.
+                */
+               String homePath = System.getenv("LTTNG_HOME");
+
+               if (homePath == null) {
+                       homePath = System.getProperty("user.home");
+               }
+               return homePath;
        }
 
        /**
This page took 0.02442 seconds and 4 git commands to generate.