Minor bug fixes
This commit is contained in:
@@ -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 i = 0; i < state->num_chunk_servers; i++)
|
||||||
for (int j = 0; j < state->chunk_servers[i].num_addrs; j++)
|
for (int j = 0; j < state->chunk_servers[i].num_addrs; j++)
|
||||||
if (addr_eql(state->chunk_servers[i].addrs[j], addr))
|
if (addr_eql(state->chunk_servers[i].addrs[j], addr))
|
||||||
return j;
|
return i;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -577,10 +577,12 @@ static int compare_processes(const void *p1, const void *p2)
|
|||||||
Process *b = *(Process**) p2;
|
Process *b = *(Process**) p2;
|
||||||
if (b->wakeup_time == INVALID_TIME) return -1;
|
if (b->wakeup_time == INVALID_TIME) return -1;
|
||||||
if (a->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;
|
int num_polled = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user