nfqws,tpws: check list files accessibility after all params are parsed

This commit is contained in:
bol-van 2025-05-04 22:01:00 +03:00
parent bda4226162
commit a426ea6dad
4 changed files with 10 additions and 0 deletions

View File

@ -287,11 +287,13 @@ static struct hostlist_file *RegisterHostlist_(struct hostlist_files_head *hostl
} }
struct hostlist_file *RegisterHostlist(struct desync_profile *dp, bool bExclude, const char *filename) struct hostlist_file *RegisterHostlist(struct desync_profile *dp, bool bExclude, const char *filename)
{ {
/*
if (filename && !file_mod_time(filename)) if (filename && !file_mod_time(filename))
{ {
DLOG_ERR("cannot access hostlist file '%s'\n",filename); DLOG_ERR("cannot access hostlist file '%s'\n",filename);
return NULL; return NULL;
} }
*/
return RegisterHostlist_( return RegisterHostlist_(
&params.hostlists, &params.hostlists,
bExclude ? &dp->hl_collection_exclude : &dp->hl_collection, bExclude ? &dp->hl_collection_exclude : &dp->hl_collection,

View File

@ -2887,6 +2887,9 @@ int main(int argc, char **argv)
#endif #endif
} }
if (!test_list_files())
exit_clean(1);
if (!LoadAllHostLists()) if (!LoadAllHostLists())
{ {
DLOG_ERR("hostlists load failed\n"); DLOG_ERR("hostlists load failed\n");

View File

@ -287,11 +287,13 @@ static struct hostlist_file *RegisterHostlist_(struct hostlist_files_head *hostl
} }
struct hostlist_file *RegisterHostlist(struct desync_profile *dp, bool bExclude, const char *filename) struct hostlist_file *RegisterHostlist(struct desync_profile *dp, bool bExclude, const char *filename)
{ {
/*
if (filename && !file_mod_time(filename)) if (filename && !file_mod_time(filename))
{ {
DLOG_ERR("cannot access hostlist file '%s'\n",filename); DLOG_ERR("cannot access hostlist file '%s'\n",filename);
return NULL; return NULL;
} }
*/
return RegisterHostlist_( return RegisterHostlist_(
&params.hostlists, &params.hostlists,
bExclude ? &dp->hl_collection_exclude : &dp->hl_collection, bExclude ? &dp->hl_collection_exclude : &dp->hl_collection,

View File

@ -1638,6 +1638,9 @@ void parse_params(int argc, char *argv[])
} }
#endif #endif
if (!test_list_files())
exit_clean(1);
if (!LoadAllHostLists()) if (!LoadAllHostLists())
{ {
DLOG_ERR("hostlists load failed\n"); DLOG_ERR("hostlists load failed\n");