allow SIGAR_PATH env var to set self_path

This commit is contained in:
Doug MacEachern 2005-12-14 18:44:01 +00:00
parent 5fc7cc7134
commit 6f67476977
1 changed files with 7 additions and 0 deletions

View File

@ -540,6 +540,13 @@ char *sigar_get_self_path(sigar_t *sigar)
{ {
if (!sigar->self_path) { if (!sigar->self_path) {
sigar_proc_modules_t procmods; sigar_proc_modules_t procmods;
char *self_path = getenv("SIGAR_PATH");
if (self_path) {
sigar->self_path = sigar_strdup(self_path);
return sigar->self_path;
}
procmods.module_getter = proc_module_get_self; procmods.module_getter = proc_module_get_self;
procmods.data = sigar; procmods.data = sigar;