mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-25 00:43:38 +00:00
Only call the expensive index_del() if unlink() did not fail.
This commit is contained in:
parent
14dd5b64c9
commit
8e7efad27f
1 changed files with 2 additions and 2 deletions
4
data.c
4
data.c
|
@ -566,8 +566,8 @@ int _object_user_cache(snac *snac, const char *id, const char *cachedir, int del
|
|||
int ret;
|
||||
|
||||
if (del) {
|
||||
index_del(idx, id); // expensive; let it fail on processing?
|
||||
ret = unlink(cfn);
|
||||
if ((ret = unlink(cfn)) != -1)
|
||||
index_del(idx, id);
|
||||
}
|
||||
else {
|
||||
index_add(idx, id);
|
||||
|
|
Loading…
Reference in a new issue