nfqws,tpws: fix hostlist-domains file open test

This commit is contained in:
bol-van 2025-02-25 13:07:38 +03:00
parent d89daaaeac
commit af89d03118
2 changed files with 4 additions and 4 deletions

View File

@ -126,14 +126,14 @@ static bool test_list_files()
struct ipset_file *ifile;
LIST_FOREACH(hfile, &params.hostlists, next)
if (!file_open_test(hfile->filename, O_RDONLY))
if (hfile->filename && !file_open_test(hfile->filename, O_RDONLY))
{
DLOG_PERROR("file_open_test");
DLOG_ERR("cannot access hostlist file '%s'\n",hfile->filename);
return false;
}
LIST_FOREACH(ifile, &params.ipsets, next)
if (!file_open_test(ifile->filename, O_RDONLY))
if (hfile->filename && !file_open_test(ifile->filename, O_RDONLY))
{
DLOG_PERROR("file_open_test");
DLOG_ERR("cannot access ipset file '%s'\n",ifile->filename);

View File

@ -122,14 +122,14 @@ static bool test_list_files()
struct ipset_file *ifile;
LIST_FOREACH(hfile, &params.hostlists, next)
if (!file_open_test(hfile->filename, O_RDONLY))
if (hfile->filename && !file_open_test(hfile->filename, O_RDONLY))
{
DLOG_PERROR("file_open_test");
DLOG_ERR("cannot access hostlist file '%s'\n",hfile->filename);
return false;
}
LIST_FOREACH(ifile, &params.ipsets, next)
if (!file_open_test(ifile->filename, O_RDONLY))
if (hfile->filename && !file_open_test(ifile->filename, O_RDONLY))
{
DLOG_PERROR("file_open_test");
DLOG_ERR("cannot access ipset file '%s'\n",ifile->filename);