mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Do not (try to) re-read deleted files inside a --hostsdir.
This commit is contained in:
committed by
Simon Kelley
parent
1bcad67806
commit
92c32e0bac
@@ -294,7 +294,11 @@ int inotify_check(time_t now)
|
|||||||
strcat(path, "/");
|
strcat(path, "/");
|
||||||
strcat(path, in->name);
|
strcat(path, in->name);
|
||||||
|
|
||||||
my_syslog(LOG_INFO, _("inotify: new, removed or changed file %s"), path);
|
/* Is this is a deletion event? */
|
||||||
|
if (in->mask & IN_DELETE)
|
||||||
|
my_syslog(LOG_INFO, _("inotify: %s (removed)"), path);
|
||||||
|
else
|
||||||
|
my_syslog(LOG_INFO, _("inotify: %s (new or modified)"), path);
|
||||||
|
|
||||||
if (dd->flags & AH_HOSTS)
|
if (dd->flags & AH_HOSTS)
|
||||||
{
|
{
|
||||||
@@ -304,6 +308,8 @@ int inotify_check(time_t now)
|
|||||||
if (removed > 0)
|
if (removed > 0)
|
||||||
my_syslog(LOG_INFO, _("flushed %u outdated entries"), removed);
|
my_syslog(LOG_INFO, _("flushed %u outdated entries"), removed);
|
||||||
|
|
||||||
|
/* (Re-)load hostsfile only if this event isn't triggered by deletion */
|
||||||
|
if (!(in->mask & IN_DELETE))
|
||||||
read_hostsfile(path, ah->index, 0, NULL, 0);
|
read_hostsfile(path, ah->index, 0, NULL, 0);
|
||||||
#ifdef HAVE_DHCP
|
#ifdef HAVE_DHCP
|
||||||
if (daemon->dhcp || daemon->doing_dhcp6)
|
if (daemon->dhcp || daemon->doing_dhcp6)
|
||||||
|
|||||||
Reference in New Issue
Block a user