int tupid_tree_copy_dup(struct tupid_entries *dest, struct tupid_entries *src) { struct tupid_tree *tt; RB_FOREACH(tt, tupid_entries, src) { if(tupid_tree_add_dup(dest, tt->tupid) < 0) return -1; } return 0; }
int environ_add_defaults(struct tupid_entries *root) { unsigned int x; struct tup_entry *tent; for(x=0; x<sizeof(default_env) / sizeof(default_env[0]); x++) { if(tup_db_findenv(default_env[x], &tent) < 0) return -1; if(tupid_tree_add_dup(root, tent->tnode.tupid) < 0) return -1; } return 0; }