config.c: added put_config()
authorArt Cancro <ajc@citadel.org>
Fri, 23 Oct 1998 23:57:59 +0000 (23:57 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 23 Oct 1998 23:57:59 +0000 (23:57 +0000)
citadel/ChangeLog
citadel/config.c

index 434e652d71ecbac78d85aea43a1a3fa8987a9798..bd92179100b667ce3f2b026c703fbd1ce6e2e7c3 100644 (file)
@@ -1,5 +1,6 @@
 Fri Oct 23 19:34:38 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * 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 <ajc@uncnsrd.mt-kisco.ny.us>
        * Mail rooms now hide their owner-prefix from the client.
index d41c0f0b1101c61e3d80f4f56933d968d4c9f284..6e1c6a9e8605abdb774f61ed8b5283b230151000 100644 (file)
@@ -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);
+       }