Minor bug fixes

This commit is contained in:
2025-11-13 23:37:42 +01:00
parent 3048f3d66b
commit 3a2173c154
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ static int find_chunk_server_by_addr(MetadataServer *state, Address addr)
for (int i = 0; i < state->num_chunk_servers; i++)
for (int j = 0; j < state->chunk_servers[i].num_addrs; j++)
if (addr_eql(state->chunk_servers[i].addrs[j], addr))
return j;
return i;
return -1;
}
+4 -2
View File
@@ -577,10 +577,12 @@ static int compare_processes(const void *p1, const void *p2)
Process *b = *(Process**) p2;
if (b->wakeup_time == INVALID_TIME) return -1;
if (a->wakeup_time == INVALID_TIME) return +1;
return a->wakeup_time - b->wakeup_time;
if (a->wakeup_time < b->wakeup_time) return -1;
if (a->wakeup_time > b->wakeup_time) return +1;
return 0;
}
static int setup_poll_array(void *contexts, struct pollfd *polled)
static int setup_poll_array(void **contexts, struct pollfd *polled)
{
int num_polled = 0;