mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-29 16:03:37 +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;
|
int ret;
|
||||||
|
|
||||||
if (del) {
|
if (del) {
|
||||||
index_del(idx, id); // expensive; let it fail on processing?
|
if ((ret = unlink(cfn)) != -1)
|
||||||
ret = unlink(cfn);
|
index_del(idx, id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
index_add(idx, id);
|
index_add(idx, id);
|
||||||
|
|
Loading…
Reference in a new issue