X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fcontrol.c;h=bad2a68d3ab893c4765d66f77af0072fe5df6fd6;hb=0b21b934f336f6bebb9251c7a1456892d5833841;hp=0b882e85529ba1e8782dd83f4894e23e80b9fae9;hpb=4146ecdb2118258ea226e8537b146ddb0b5bd7a6;p=citadel.git diff --git a/citadel/control.c b/citadel/control.c index 0b882e855..bad2a68d3 100644 --- a/citadel/control.c +++ b/citadel/control.c @@ -64,13 +64,25 @@ void get_control(void) */ memset(&CitControl, 0, sizeof(struct CitControl)); if (control_fp == NULL) { - control_fp = fopen("citadel.control", "rb+"); + control_fp = fopen( +#ifndef HAVE_RUN_DIR + "." +#else + RUN_DIR +#endif + "/citadel.control", "rb+"); if (control_fp != NULL) { fchown(fileno(control_fp), config.c_ctdluid, -1); } } if (control_fp == NULL) { - control_fp = fopen("citadel.control", "wb+"); + control_fp = fopen( +#ifndef HAVE_RUN_DIR + "." +#else + RUN_DIR +#endif + "/citadel.control", "wb+"); if (control_fp != NULL) { fchown(fileno(control_fp), config.c_ctdluid, -1); memset(&CitControl, 0, sizeof(struct CitControl));