Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generation of paths of synced variables #37

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions syncer.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ static guint sync_timer = 0;

/* keep a list of the paths we are syncing */
GList *paths = NULL;
GList *excluded_paths = NULL;
pthread_rwlock_t paths_lock = PTHREAD_RWLOCK_INITIALIZER;

static uint64_t
Expand Down Expand Up @@ -329,18 +328,13 @@ sync_tree_process (GNode *node, gpointer arg)
{
uint64_t ts;
sync_params *params = (sync_params *) arg;
char *path = apteryx_node_path (node);
char *path = apteryx_node_path (node->parent);

if (path)
{
if (!sync_path_excluded (params->entry, path))
{
/* The timestamp is stored on the parent of the value. */
char *ptr = strrchr (path, '/');
if (ptr)
{
*ptr = '\0';
}
ts = apteryx_timestamp (path);
if (ts && ts > params->ts)
{
Expand Down Expand Up @@ -520,17 +514,11 @@ sync_find_sync_entry (GNode *node)
static gboolean
new_change_process (GNode *node, gpointer arg)
{
char *path = apteryx_node_path (node);
char *path = apteryx_node_path (node->parent);
char *value = NULL;
sync_entry *entry = (sync_entry *) arg;
if (path)
{
char *ptr = strrchr (path, '/');
if (ptr)
{
*ptr = '\0';
}

if (!sync_path_excluded (entry, path))
{
if (node->data && ((char *) node->data)[0] != '\0')
Expand Down
Loading