diff options
| author | 2022-12-03 21:59:19 +0100 | |
|---|---|---|
| committer | 2022-12-03 21:59:19 +0100 | |
| commit | 002bec4deff7abf9823bbd80c0174785a0713de7 (patch) | |
| tree | 446156cd38deaa3f38f6150c770cc9fd9d2f2dc3 | |
| parent | From timeline_admire(), add to both caches. (diff) | |
| download | snac2-002bec4deff7abf9823bbd80c0174785a0713de7.tar.gz snac2-002bec4deff7abf9823bbd80c0174785a0713de7.tar.xz snac2-002bec4deff7abf9823bbd80c0174785a0713de7.zip | |
In _object_user_cache(), don't call index_add() if link() fails.
It will most probably fail because the object is already there.
| -rw-r--r-- | data.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -657,8 +657,8 @@ int _object_user_cache(snac *snac, const char *id, const char *cachedir, int del | |||
| 657 | index_del(idx, id); | 657 | index_del(idx, id); |
| 658 | } | 658 | } |
| 659 | else { | 659 | else { |
| 660 | index_add(idx, id); | 660 | if ((ret = link(ofn, cfn)) != -1) |
| 661 | ret = link(ofn, cfn); | 661 | index_add(idx, id); |
| 662 | } | 662 | } |
| 663 | 663 | ||
| 664 | return ret; | 664 | return ret; |