mirror of
https://github.com/bol-van/zapret2.git
synced 2026-10-29 06:02:05 +00:00
nfqws2: fix hostlist and ipset load if modtime is unixtime 0
This commit is contained in:
1 parent
3b465d9981
commit
37e5a8a880
3 files changed
+3
-3
No files matched your search
+1
-1
@@ -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
@@ -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
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user