X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fconfig.c;h=996118816cbe14086861d8365a051465fc4ae085;hb=0b21b934f336f6bebb9251c7a1456892d5833841;hp=8562f3472f213f4e4ddbe2113d227464c38a60e0;hpb=4146ecdb2118258ea226e8537b146ddb0b5bd7a6;p=citadel.git diff --git a/citadel/config.c b/citadel/config.c index 8562f3472..996118816 100644 --- a/citadel/config.c +++ b/citadel/config.c @@ -45,7 +45,13 @@ void get_config(void) { strerror(errno)); exit(1); } - cfp = fopen("citadel.config", "rb"); + cfp = fopen( +#ifndef HAVE_ETC_DIR + "." +#else + ETC_DIR +#endif + "/citadel.config", "rb"); if (cfp == NULL) { fprintf(stderr, "This program could not be started.\n" "Unable to open %s/citadel.config\n" @@ -116,7 +122,13 @@ void put_config(void) { FILE *cfp; - if ((cfp = fopen("citadel.config", "rb+")) == NULL) + if ((cfp = fopen( +#ifndef HAVE_ETC_DIR + "." +#else + ETC_DIR +#endif + "/citadel.config", "rb+")) == NULL) perror("citadel.config"); else { fwrite((char *) &config, sizeof(struct config), 1, cfp);