- return 0;
-
- /* permanent, remove_resv() needs to do it properly */
- if(!aconf->hold)
- return 0;
-
- /* already have ptr from the loop above.. */
- dlinkDestroy(ptr, &resv_conf_list);
- free_conf(aconf);
- }
-
- sendto_one_notice(source_p, ":RESV for [%s] is removed", name);
- sendto_realops_snomask(SNO_GENERAL, L_ALL,
- "%s has removed the RESV for: [%s]",
- get_oper_name(source_p), name);
- ilog(L_KLINE, "UR %s %s", get_oper_name(source_p), name);
-
- return 1;
-}
-
-/* remove_resv()
- *
- * inputs - client removing the resv
- * - resv to remove
- * outputs -
- * side effects - resv if found, is removed
- */
-static void
-remove_resv(struct Client *source_p, const char *name)
-{
- FILE *in, *out;
- char buf[BUFSIZE];
- char buff[BUFSIZE];
- char temppath[BUFSIZE];
- const char *filename;
- mode_t oldumask;
- char *p;
- int error_on_write = 0;
- int found_resv = 0;
-
- ircsprintf(temppath, "%s.tmp", ConfigFileEntry.resvfile);
- filename = get_conf_name(RESV_TYPE);
-
- if((in = fopen(filename, "r")) == NULL)
- {
- sendto_one_notice(source_p, ":Cannot open %s", filename);
- return;
- }
-
- oldumask = umask(0);
-
- if((out = fopen(temppath, "w")) == NULL)
- {
- sendto_one_notice(source_p, ":Cannot open %s", temppath);
- fclose(in);
- umask(oldumask);
- return;
- }
-
- umask(oldumask);
-
- while (fgets(buf, sizeof(buf), in))
- {
- const char *resv_name;
-
- if(error_on_write)
- {
- if(temppath != NULL)
- (void) unlink(temppath);
-
- break;
- }
-
- strlcpy(buff, buf, sizeof(buff));
-
- if((p = strchr(buff, '\n')) != NULL)
- *p = '\0';
-
- if((*buff == '\0') || (*buff == '#'))