X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Flib%2Flttng-ust-java-agent%2Fjava%2Flttng-ust-agent-common%2Forg%2Flttng%2Fust%2Fagent%2Fclient%2FLttngTcpSessiondClient.java;h=2c44a0df98f5455c3eb15cc7c2f5a3bc05e85f1a;hb=90d125c709f566f3663bf84677f100134cc618e0;hp=9fa8c3acdbcfbc22cf3d873d184b9011835b414b;hpb=3081c83f06d9a65cae1507a5db358df84ed7c192;p=lttng-ust.git diff --git a/src/lib/lttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/client/LttngTcpSessiondClient.java b/src/lib/lttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/client/LttngTcpSessiondClient.java index 9fa8c3ac..2c44a0df 100644 --- a/src/lib/lttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/client/LttngTcpSessiondClient.java +++ b/src/lib/lttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/client/LttngTcpSessiondClient.java @@ -41,7 +41,7 @@ public class LttngTcpSessiondClient implements Runnable { private static final int PROTOCOL_MAJOR_VERSION = 2; private static final int PROTOCOL_MINOR_VERSION = 0; - /** Command header from the session deamon. */ + /** Command header from the session daemon. */ private final CountDownLatch registrationLatch = new CountDownLatch(1); private Socket sessiondSock; @@ -197,15 +197,29 @@ public class LttngTcpSessiondClient implements Runnable { private static String getHomePath() { /* + * The environment variable LTTNG_UST_HOME overrides LTTNG_HOME + * if present. * The environment variable LTTNG_HOME overrides HOME if * defined. */ - String homePath = System.getenv("LTTNG_HOME"); + String lttngUstHomePath = System.getenv("LTTNG_UST_HOME"); + String lttngHomePath = System.getenv("LTTNG_HOME"); + + if (lttngUstHomePath != null) { + /* + * LTTNG_UST_HOME has priority over LTTNG_HOME and user + * home directory. + */ + return lttngUstHomePath; + } - if (homePath == null) { - homePath = System.getProperty("user.home"); + if (lttngHomePath != null) { + /* LTTNG_HOME has priority over user home directory. */ + return lttngHomePath; } - return homePath; + + /* Default to the user home directory. */ + return System.getProperty("user.home"); } /**