In _object_user_cache(), don't call index_add() if link() fails.

It will most probably fail because the object is already there.
This commit is contained in:
default 2022-12-03 21:59:19 +01:00
parent 85d0f40e65
commit 002bec4def

2
data.c
View file

@ -657,8 +657,8 @@ int _object_user_cache(snac *snac, const char *id, const char *cachedir, int del
index_del(idx, id); index_del(idx, id);
} }
else { else {
if ((ret = link(ofn, cfn)) != -1)
index_add(idx, id); index_add(idx, id);
ret = link(ofn, cfn);
} }
return ret; return ret;