Fixes SourceForge bug #
3000577.
src/chanserv.c (expire_channels): Only (re-)add this function to timeq
if the data argument is NULL.
(cmd_expire): Pass a non-NULL pointer when calling expire_channels().
-expire_channels(UNUSED_ARG(void *data))
+expire_channels(void *data)
{
struct chanData *channel, *next;
struct userData *user;
{
struct chanData *channel, *next;
struct userData *user;
unregister_channel(channel, "registration expired.");
}
unregister_channel(channel, "registration expired.");
}
- if(chanserv_conf.channel_expire_frequency)
+ if(chanserv_conf.channel_expire_frequency && !data)
timeq_add(now + chanserv_conf.channel_expire_frequency, expire_channels, NULL);
}
timeq_add(now + chanserv_conf.channel_expire_frequency, expire_channels, NULL);
}
static CHANSERV_FUNC(cmd_expire)
{
int channel_count = registered_channels;
static CHANSERV_FUNC(cmd_expire)
{
int channel_count = registered_channels;
+ expire_channels(chanserv);
reply("CSMSG_CHANNELS_EXPIRED", channel_count - registered_channels);
return 1;
}
reply("CSMSG_CHANNELS_EXPIRED", channel_count - registered_channels);
return 1;
}