mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-26 06:53:37 +00:00
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:
parent
85d0f40e65
commit
002bec4def
1 changed files with 2 additions and 2 deletions
4
data.c
4
data.c
|
@ -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 {
|
||||||
index_add(idx, id);
|
if ((ret = link(ofn, cfn)) != -1)
|
||||||
ret = link(ofn, cfn);
|
index_add(idx, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue