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;
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");
}
/**