summaryrefslogtreecommitdiff
path: root/apps/tagcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tagcache.c')
-rw-r--r--apps/tagcache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index 9719e4e651..248e57237d 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -443,7 +443,7 @@ static int open_master_fd(struct master_header *hdr, bool write)
443 443
444 /* Check the header. */ 444 /* Check the header. */
445 rc = read(fd, hdr, sizeof(struct master_header)); 445 rc = read(fd, hdr, sizeof(struct master_header));
446 if (hdr->tch.magic == TAGCACHE_MAGIC && rc == sizeof(struct master_header)) 446 if (rc == sizeof(struct master_header) && hdr->tch.magic == TAGCACHE_MAGIC)
447 { 447 {
448 /* Success. */ 448 /* Success. */
449 return fd; 449 return fd;
@@ -453,7 +453,7 @@ static int open_master_fd(struct master_header *hdr, bool write)
453 lseek(fd, 0, SEEK_SET); 453 lseek(fd, 0, SEEK_SET);
454 454
455 rc = ecread(fd, hdr, 1, master_header_ec, true); 455 rc = ecread(fd, hdr, 1, master_header_ec, true);
456 if (hdr->tch.magic != TAGCACHE_MAGIC || rc != sizeof(struct master_header)) 456 if (rc != sizeof(struct master_header) || hdr->tch.magic != TAGCACHE_MAGIC)
457 { 457 {
458 logf("header error"); 458 logf("header error");
459 tc_stat.ready = false; 459 tc_stat.ready = false;
@@ -3935,13 +3935,13 @@ static void fix_ramcache(void* old_addr, void* new_addr)
3935 3935
3936static int move_cb(int handle, void* current, void* new) 3936static int move_cb(int handle, void* current, void* new)
3937{ 3937{
3938 (void)handle;
3938 if (tcramcache.move_lock > 0) 3939 if (tcramcache.move_lock > 0)
3939 return BUFLIB_CB_CANNOT_MOVE; 3940 return BUFLIB_CB_CANNOT_MOVE;
3940 3941
3941 fix_ramcache(current, new); 3942 fix_ramcache(current, new);
3942 tcramcache.hdr = new; 3943 tcramcache.hdr = new;
3943 return BUFLIB_CB_OK; 3944 return BUFLIB_CB_OK;
3944 (void)handle;
3945} 3945}
3946 3946
3947static struct buflib_callbacks ops = { 3947static struct buflib_callbacks ops = {