Skip to content

Commit

Permalink
apteryx-saver: Check for apteryx_query() failure whilst writing config
Browse files Browse the repository at this point in the history
Check for apteryx_query() failure whilst writing config. Apteryx_query()
can return NULL if a refresher path included in the query doesn't
respond to apteryxd.
  • Loading branch information
coledishington authored and carlgsmith committed Nov 29, 2023
1 parent ec3f7cf commit c1dcf6d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion saver.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,14 @@ write_config_process (gpointer arg1)
apteryx_free_tree (config_nodes);
config_nodes = apteryx_query (saver_nodes);
}
_write_config ();
if (config_nodes)
{
_write_config ();
}
else
{
ERROR("Failed to fetch config to write");
}
pthread_mutex_unlock (&config_lock);
return G_SOURCE_CONTINUE;
}
Expand Down

0 comments on commit c1dcf6d

Please sign in to comment.