From: Brian Aker Date: Wed, 20 Jan 2010 17:20:32 +0000 (-0800) Subject: 32bit fix. X-Git-Tag: 0.40~72 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=e4de44ab09f5ff7fdf10c8cdfce95f361b62b4ae;p=m6w6%2Flibmemcached 32bit fix. --- diff --git a/clients/ms_conn.c b/clients/ms_conn.c index 9f92d423..86e98fe1 100644 --- a/clients/ms_conn.c +++ b/clients/ms_conn.c @@ -2752,18 +2752,18 @@ static uint32_t ms_get_rep_sock_index(ms_conn_t *c, int cmd) if (i == ms_setting.rep_write_srv) { /* random get one replication server to read */ - sock_index= (uint32_t)(random() % c->total_sfds); + sock_index= (uint32_t)random() % c->total_sfds; } else { /* random get one replication writing server to write */ - sock_index= (uint32_t)(random() % ms_setting.rep_write_srv); + sock_index= (uint32_t)random() % ms_setting.rep_write_srv; } } else if (cmd == CMD_GET) { /* random get one replication server to read */ - sock_index= (uint32_t)(random() % c->total_sfds); + sock_index= (uint32_t)random() % c->total_sfds; } } while (c->tcpsfd[sock_index] == 0);