summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/tagcache.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index bff1550059..e6a4e8e3c4 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -2239,7 +2239,7 @@ static bool build_numeric_indices(struct tagcache_header *h, int tmpfd)
2239 2239
2240 masterfd_pos = lseek(masterfd, tcmh.tch.entry_count * sizeof(struct index_entry), 2240 masterfd_pos = lseek(masterfd, tcmh.tch.entry_count * sizeof(struct index_entry),
2241 SEEK_CUR); 2241 SEEK_CUR);
2242 if (masterfd_pos == filesize(masterfd)) 2242 if (masterfd_pos < 0)
2243 { 2243 {
2244 logf("we can't append!"); 2244 logf("we can't append!");
2245 close(masterfd); 2245 close(masterfd);
@@ -2988,12 +2988,7 @@ static bool commit(void)
2988 } 2988 }
2989 2989
2990 if (tch.entry_count == 0) 2990 if (tch.entry_count == 0)
2991 {
2992 logf("nothing to commit"); 2991 logf("nothing to commit");
2993 close(tmpfd);
2994 remove(TAGCACHE_FILE_TEMP);
2995 return true;
2996 }
2997 2992
2998 /* Fully initialize existing headers (if any) before going further. */ 2993 /* Fully initialize existing headers (if any) before going further. */
2999 tc_stat.ready = check_all_headers(); 2994 tc_stat.ready = check_all_headers();