From 3ed035769c53d1b8957535c6e6bd8a2e56058d80 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 19 May 2021 16:30:32 -0400 Subject: FS#9093: Database initialization hangs if there's no music file on the player Original patch by William Poetra Yoga Hadisoeseno Change-Id: I198a4d1b2899bd9200a35dbefd034a2e9857fa19 --- apps/tagcache.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'apps') 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) masterfd_pos = lseek(masterfd, tcmh.tch.entry_count * sizeof(struct index_entry), SEEK_CUR); - if (masterfd_pos == filesize(masterfd)) + if (masterfd_pos < 0) { logf("we can't append!"); close(masterfd); @@ -2988,12 +2988,7 @@ static bool commit(void) } if (tch.entry_count == 0) - { logf("nothing to commit"); - close(tmpfd); - remove(TAGCACHE_FILE_TEMP); - return true; - } /* Fully initialize existing headers (if any) before going further. */ tc_stat.ready = check_all_headers(); -- cgit v1.2.3