summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index 432adfc..d4097ef 100644
--- a/eval.c
+++ b/eval.c
@@ -1147,14 +1147,17 @@ static bool eval_file_unique(struct eval_state *state, struct trie *seen) {
memcpy(id, &statbuf->dev, sizeof(statbuf->dev));
memcpy(id + sizeof(statbuf->dev), &statbuf->ino, sizeof(statbuf->ino));
- int ret = trie_meminsert(seen, id, sizeof(id));
- if (ret > 0) {
- state->action = BFTW_SKIP_SUBTREE;
- return false;
- } else if (ret < 0) {
+ struct trie_leaf *leaf = trie_insert_mem(seen, id, sizeof(id));
+ if (!leaf) {
eval_report_error(state);
return false;
+ }
+
+ if (leaf->value) {
+ state->action = BFTW_SKIP_SUBTREE;
+ return false;
} else {
+ leaf->value = leaf;
return true;
}
}