mirror of
https://github.com/pissnet/pissircd.git
synced 2025-08-05 09:45:23 +01:00
Don't call hbm_delete_db() if not running in persistent mode.
This commit is contained in:
parent
ae873ab25a
commit
cb3c0b48ca
1 changed files with 12 additions and 1 deletions
|
@ -431,6 +431,9 @@ int hbm_modechar_del(Channel *channel, int modechar)
|
|||
{
|
||||
HistoryLogObject *h;
|
||||
|
||||
if (!cfg.persist)
|
||||
return 0;
|
||||
|
||||
if ((modechar == 'P') && ((h = hbm_find_object(channel->chname))))
|
||||
{
|
||||
/* Channel went from +P to -P and also has channel history: delete the history file */
|
||||
|
@ -1162,6 +1165,14 @@ static int hbm_write_db(HistoryLogObject *h)
|
|||
static void hbm_delete_db(HistoryLogObject *h)
|
||||
{
|
||||
UnrealDB *db;
|
||||
char *fname = hbm_history_filename(h);
|
||||
char *fname;
|
||||
if (!cfg.persist || !cfg.prehash || !cfg.posthash)
|
||||
{
|
||||
#ifdef DEBUGMODE
|
||||
abort(); /* we should not be called, so debug this */
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
fname = hbm_history_filename(h);
|
||||
unlink(fname);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue