From: Art Cancro Date: Fri, 23 Oct 1998 23:57:59 +0000 (+0000) Subject: config.c: added put_config() X-Git-Tag: v7.86~8242 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=793a5f1f95421788902af90d10425706e601d001 config.c: added put_config() --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 434e652d7..bd9217910 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,5 +1,6 @@ Fri Oct 23 19:34:38 EDT 1998 Art Cancro * setup.c: default node name is now obtained from uname() + * config.c: added put_config() Wed Oct 21 22:24:48 EDT 1998 Art Cancro * Mail rooms now hide their owner-prefix from the client. diff --git a/citadel/config.c b/citadel/config.c index d41c0f0b1..6e1c6a9e8 100644 --- a/citadel/config.c +++ b/citadel/config.c @@ -26,7 +26,7 @@ void get_config(void) { strerror(errno)); exit(errno); } - cfp=fopen("citadel.config","r"); + cfp=fopen("citadel.config","rb"); if (cfp==NULL) { fprintf(stderr, "Cannot start.\n"); fprintf(stderr, "There is no citadel.config in %s\n%s\n", @@ -49,3 +49,16 @@ void get_config(void) { exit(1); } } + + +/* + * Occasionally, we will need to write the config file, because some operations + * change site-wide parameters. + */ +void put_config(void) { + FILE *cfp; + + cfp = fopen("citadel.config", "rb+"); + fwrite((char *)&config, sizeof(struct config), 1, cfp); + fclose(cfp); + }