aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-04-15 09:50:30 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-04-15 09:50:30 -0400
commit208962dfdbd24788a6decf1839ecbbf584fb2e09 (patch)
tree00ed3dc1cebc5b06df69507685e1ba66455ad382
parent97624c22ea3e643e598af782c7f1f40aceeea970 (diff)
downloadstasis-208962dfdbd24788a6decf1839ecbbf584fb2e09.tar.gz
Issue a warning if omc.ini is not present at the installed location. (Or wherever OMC_SYSCONFDIR points to)
-rw-r--r--src/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index e070911..0b2fab8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -327,8 +327,10 @@ int main(int argc, char *argv[]) {
// no configuration passed by argument. use basic config.
char cfgfile[PATH_MAX * 2];
sprintf(cfgfile, "%s/%s", globals.sysconfdir, "omc.ini");
- if (!access(cfgfile, F_OK)) {
+ if (!access(cfgfile, F_OK | R_OK)) {
config_input = strdup(cfgfile);
+ } else {
+ msg(OMC_MSG_WARN, "OMC global configuration is not readable, or does not exist: %s", cfgfile);
}
}