diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/tagcache.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c index 05e224543c..2b4f1a2181 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c | |||
@@ -3464,11 +3464,14 @@ static bool delete_entry(long idx_id) | |||
3464 | } | 3464 | } |
3465 | 3465 | ||
3466 | myidx.flag |= FLAG_DELETED; | 3466 | myidx.flag |= FLAG_DELETED; |
3467 | #ifdef HAVE_TC_RAMCACHE | 3467 | lseek(masterfd, -sizeof(struct index_entry), SEEK_CUR); |
3468 | if (tc_stat.ramcache) | 3468 | if (ecwrite(masterfd, &myidx, 1, index_entry_ec, tc_stat.econ) |
3469 | hdr->indices[idx_id].flag |= FLAG_DELETED; | 3469 | != sizeof(struct index_entry)) |
3470 | #endif | 3470 | { |
3471 | 3471 | logf("delete_entry(): write_error #1"); | |
3472 | goto cleanup; | ||
3473 | } | ||
3474 | |||
3472 | /* Now check which tags are no longer in use (if any) */ | 3475 | /* Now check which tags are no longer in use (if any) */ |
3473 | for (tag = 0; tag < TAG_COUNT; tag++) | 3476 | for (tag = 0; tag < TAG_COUNT; tag++) |
3474 | in_use[tag] = 0; | 3477 | in_use[tag] = 0; |
@@ -3573,7 +3576,7 @@ static bool delete_entry(long idx_id) | |||
3573 | /* Delete from ram. */ | 3576 | /* Delete from ram. */ |
3574 | if (tc_stat.ramcache && tag != tag_filename) | 3577 | if (tc_stat.ramcache && tag != tag_filename) |
3575 | { | 3578 | { |
3576 | struct tagfile_entry *tagentry = get_tag(&myidx, tag); | 3579 | struct tagfile_entry *tagentry = (struct tagfile_entry *)&hdr->tags[tag][oldseek]; |
3577 | tagentry->tag_data[0] = '\0'; | 3580 | tagentry->tag_data[0] = '\0'; |
3578 | } | 3581 | } |
3579 | #endif | 3582 | #endif |
@@ -3609,7 +3612,7 @@ static bool delete_entry(long idx_id) | |||
3609 | if (ecwrite(masterfd, &myidx, 1, index_entry_ec, tc_stat.econ) | 3612 | if (ecwrite(masterfd, &myidx, 1, index_entry_ec, tc_stat.econ) |
3610 | != sizeof(struct index_entry)) | 3613 | != sizeof(struct index_entry)) |
3611 | { | 3614 | { |
3612 | logf("delete_entry(): write_error"); | 3615 | logf("delete_entry(): write_error #2"); |
3613 | goto cleanup; | 3616 | goto cleanup; |
3614 | } | 3617 | } |
3615 | 3618 | ||