forked from Telodendria/Telodendria
Don't make assumptions about where the config file is.
This commit is contained in:
parent
be3b73f2af
commit
84f311ae09
1 changed files with 8 additions and 2 deletions
|
@ -132,7 +132,7 @@ main(int argc, char **argv)
|
|||
/* Arg parsing */
|
||||
int opt;
|
||||
int flags = 0;
|
||||
char *configArg = "/etc/telodendria.conf";
|
||||
char *configArg = NULL;
|
||||
|
||||
/* Config file */
|
||||
FILE *configFile = NULL;
|
||||
|
@ -205,7 +205,13 @@ main(int argc, char **argv)
|
|||
goto finish;
|
||||
}
|
||||
|
||||
if (strcmp(configArg, "-") == 0)
|
||||
if (!configArg)
|
||||
{
|
||||
Log(lc, LOG_ERROR, "No configuration file specified.");
|
||||
exit = EXIT_FAILURE;
|
||||
goto finish;
|
||||
}
|
||||
else if (strcmp(configArg, "-") == 0)
|
||||
{
|
||||
configFile = stdin;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue