projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: ustctl_get_stream_id without UST support
[lttng-tools.git]
/
src
/
common
/
utils.c
diff --git
a/src/common/utils.c
b/src/common/utils.c
index 9821815ba06298dfbb7e76de02bbc385b9d49d0d..b640b950e7e3d88ac95a966d60e76acaa1a88121 100644
(file)
--- a/
src/common/utils.c
+++ b/
src/common/utils.c
@@
-822,11
+822,28
@@
LTTNG_HIDDEN
char *utils_get_home_dir(void)
{
char *val = NULL;
char *utils_get_home_dir(void)
{
char *val = NULL;
+ struct passwd *pwd;
+
val = getenv(DEFAULT_LTTNG_HOME_ENV_VAR);
if (val != NULL) {
val = getenv(DEFAULT_LTTNG_HOME_ENV_VAR);
if (val != NULL) {
- return val;
+ goto end;
+ }
+ val = getenv(DEFAULT_LTTNG_FALLBACK_HOME_ENV_VAR);
+ if (val != NULL) {
+ goto end;
}
}
- return getenv(DEFAULT_LTTNG_FALLBACK_HOME_ENV_VAR);
+
+ /* Fallback on the password file entry. */
+ pwd = getpwuid(getuid());
+ if (!pwd) {
+ goto end;
+ }
+ val = pwd->pw_dir;
+
+ DBG3("Home directory is '%s'", val);
+
+end:
+ return val;
}
/**
}
/**
@@
-869,6
+886,16
@@
end:
return home_dir;
}
return home_dir;
}
+/*
+ * Obtain the value of LTTNG_KMOD_PROBES environment variable, if exists.
+ * Otherwise returns an empty string.
+ */
+LTTNG_HIDDEN
+char *utils_get_kmod_probes_list(void)
+{
+ return getenv(DEFAULT_LTTNG_KMOD_PROBES);
+}
+
/*
* With the given format, fill dst with the time of len maximum siz.
*
/*
* With the given format, fill dst with the time of len maximum siz.
*
This page took
0.023697 seconds
and
4
git commands to generate.