state: add ability to sync a state to if_collection cache

This commit is contained in:
Ariadne Conill 2020-07-24 04:48:50 -06:00
parent a3c138b9b2
commit e0a7444640
3 changed files with 25 additions and 2 deletions

View file

@ -170,13 +170,19 @@ ifupdown_main(int argc, char *argv[])
if (!lif_state_read_path(&state, state_file))
{
fprintf(stderr, "ifquery: could not parse %s\n", state_file);
fprintf(stderr, "%s: could not parse %s\n", argv0, state_file);
return EXIT_FAILURE;
}
if (!lif_interface_file_parse(&collection, interfaces_file))
{
fprintf(stderr, "ifquery: could not parse %s\n", interfaces_file);
fprintf(stderr, "%s: could not parse %s\n", argv0, interfaces_file);
return EXIT_FAILURE;
}
if (!lif_state_sync(&state, &collection))
{
fprintf(stderr, "%s: could not sync state\n", argv0);
return EXIT_FAILURE;
}