*/
void get_control(void)
{
+ static int already_have_control = 0;
+
+ /*
+ * If we already have the control record in memory, there's no point
+ * in reading it from disk again.
+ */
+ if (already_have_control) return;
+
/* Zero it out. If the control record on disk is missing or short,
* the system functions with all control record fields initialized
* to zero.
rewind(control_fp);
fread(&CitControl, sizeof(struct CitControl), 1, control_fp);
+ already_have_control = 1;
}
/*
}
-void get_mm(void)
-{
- FILE *fp;
-
- fp = fopen(file_citadel_control, "r");
- if (fp == NULL) {
- lprintf(CTDL_CRIT, "Cannot open %s: %s\n",
- file_citadel_control,
- strerror(errno));
- exit(errno);
- }
- fread((char *) &CitControl, sizeof(struct CitControl), 1, fp);
- fclose(fp);
-}
-
-
/*
* Back end for the MSGS command: output message number only.
*/
long *search_msgs = NULL;
/* Learn about the user and room in question */
- get_mm();
getuser(&CC->user, CC->curr_user);
CtdlGetRelationship(&vbuf, &CC->user, &CC->room);
extern struct addresses_to_be_filed *atbf;
int alias (char *name);
-void get_mm (void);
void cmd_msgs (char *cmdbuf);
void cmd_isme (char *cmdbuf);
void help_subst (char *strbuf, char *source, char *dest);
info = 1;
}
- get_mm();
cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long));
if (cdbfr != NULL) {
msglist = (long *) cdbfr->ptr;