diff options
-rw-r--r-- | src/stasis_indexer.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/stasis_indexer.c b/src/stasis_indexer.c index b0c8a26..4a9c071 100644 --- a/src/stasis_indexer.c +++ b/src/stasis_indexer.c @@ -763,6 +763,18 @@ int main(int argc, char *argv[]) { exit(1); } } + + char stasis_sysconfdir_tmp[PATH_MAX]; + if (getenv("STASIS_SYSCONFDIR")) { + strncpy(stasis_sysconfdir_tmp, getenv("STASIS_SYSCONFDIR"), sizeof(stasis_sysconfdir_tmp) - 1); + } else { + strncpy(stasis_sysconfdir_tmp, STASIS_SYSCONFDIR, sizeof(stasis_sysconfdir_tmp) - 1); + } + + globals.sysconfdir = realpath(stasis_sysconfdir_tmp, NULL); + if (!globals.sysconfdir) { + msg(STASIS_MSG_ERROR | STASIS_MSG_L1, "Unable to resolve path to configuration directory: %s\n", stasis_sysconfdir_tmp); + exit(1); } char *workdir; |