- error_on_write = (fputs(buf, out) < 0) ? YES : NO;
- }
- }
-
- fclose(in);
- if (fclose(out))
- error_on_write = YES;
-
- if(error_on_write)
- {
- sendto_one_notice(source_p, ":Couldn't write temp resv file, aborted");
- return 0;
- }
- else if(!found_resv)
- {
- sendto_one_notice(source_p, ":Cannot find RESV for %s in file", name);
-
- if(temppath != NULL)
- (void) unlink(temppath);
-
- return 0;
- }
-
- if (rename(temppath, filename))
- {
- sendto_one_notice(source_p, ":Couldn't rename temp file, aborted");
- return 0;
- }
-
- 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;
-}
-
-static void
-resv_chan_forcepart(const char *name, const char *reason, int temp_time)
-{
- rb_dlink_node *ptr;
- rb_dlink_node *next_ptr;
- struct Channel *chptr;
- struct membership *msptr;
- struct Client *target_p;
-
- if(!ConfigChannel.resv_forcepart)
- return;
-
- /* for each user on our server in the channel list
- * send them a PART, and notify opers.
- */
- chptr = find_channel(name);
- if(chptr != NULL)
- {
- RB_DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->locmembers.head)
- {
- msptr = ptr->data;
- target_p = msptr->client_p;
-
- if(IsExemptResv(target_p))
- continue;
-
- sendto_server(target_p, chptr, CAP_TS6, NOCAPS,
- ":%s PART %s", target_p->id, chptr->chname);
-
- sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s PART %s :%s",
- target_p->name, target_p->username,
- target_p->host, chptr->chname, target_p->name);
-
- remove_user_from_channel(msptr);
-
- /* notify opers & user they were removed from the channel */