diff --git a/nfq2/helpers.c b/nfq2/helpers.c index a7e5a59..5da62da 100644 --- a/nfq2/helpers.c +++ b/nfq2/helpers.c @@ -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) diff --git a/nfq2/hostlist.c b/nfq2/hostlist.c index 75701a2..de95e31 100644 --- a/nfq2/hostlist.c +++ b/nfq2/hostlist.c @@ -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; diff --git a/nfq2/ipset.c b/nfq2/ipset.c index 732513a..347bc9f 100644 --- a/nfq2/ipset.c +++ b/nfq2/ipset.c @@ -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;