nfqws2: fix hostlist and ipset load if modtime is unixtime 0

This commit is contained in:
bol-van committed 2026-07-30 17:16:16 +03:00
1 parent 3b465d9981
commit 37e5a8a880
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -424,7 +424,7 @@ bool file_size(const char *filename, off_t *size)
{
struct stat st;
if (stat(filename, &st) == -1) return false;
*size = st.st_size;
if (size) *size = st.st_size;
return true;
}
time_t file_mod_time(const char *filename)
+1 -1
View File
@@ -309,7 +309,7 @@ static struct hostlist_file *RegisterHostlist_(struct hostlist_files_head *hostl
}
struct hostlist_file *RegisterHostlist(struct desync_profile *dp, bool bExclude, const char *filename)
{
if (filename && !file_mod_time(filename))
if (filename && !file_size(filename,NULL))
{
DLOG_ERR("cannot access hostlist file '%s'\n",filename);
return NULL;
+1 -1
View File
@@ -310,7 +310,7 @@ static struct ipset_file *RegisterIpset_(struct ipset_files_head *ipsets, struct
}
struct ipset_file *RegisterIpset(struct desync_profile *dp, bool bExclude, const char *filename)
{
if (filename && !file_mod_time(filename))
if (filename && !file_size(filename,NULL))
{
DLOG_ERR("cannot access ipset file '%s'\n",filename);
return NULL;