mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Respect sysconfdir for configuration file location
The sysconfdir is used if it exists, otherwise it fallbacks to the previous default /etc.
This commit is contained in:
parent
8f625f2be4
commit
ee1aa840f1
5 changed files with 40 additions and 16 deletions
|
|
@ -241,7 +241,13 @@ void config(char* conf, size_t conf_size, const char* argv0)
|
|||
#else
|
||||
(void)argv0;
|
||||
|
||||
pathcpy(conf, conf_size, "/etc/" PACKAGE ".conf");
|
||||
#ifdef SYSCONFDIR
|
||||
/* if it exists, give precedence at sysconfdir, usually /usr/local/etc */
|
||||
if (access(SYSCONFDIR "/" PACKAGE ".conf", F_OK) == 0)
|
||||
pathcpy(conf, conf_size, SYSCONFDIR "/" PACKAGE ".conf");
|
||||
else /* otherwise fallback to plain /etc */
|
||||
#endif
|
||||
pathcpy(conf, conf_size, "/etc/" PACKAGE ".conf");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue