aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-05 17:44:44 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-05 17:44:44 +0000
commite0ba99b7f5b9f06dda7fe4baa8a7fb90e2ab40c8 (patch)
tree6334c0ffd529b865c510fbfb7a06b71e2c6d6ceb /apps/app_queue.c
parent54a140d030be645458cc82416501f0386e1d9e4b (diff)
Bug 6873 - Finish moving from the non-threadsafe (and poor randomness) rand() to threadsafe ast_random()
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@17627 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 9259bd77d..f79bb8a7c 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1992,7 +1992,7 @@ static int calc_metric(struct ast_call_queue *q, struct member *mem, int pos, st
tmp->metric += mem->penalty * 1000000;
break;
case QUEUE_STRATEGY_RANDOM:
- tmp->metric = rand() % 1000;
+ tmp->metric = ast_random() % 1000;
tmp->metric += mem->penalty * 1000000;
break;
case QUEUE_STRATEGY_FEWESTCALLS:
@@ -2241,7 +2241,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
else {
/* Last ditch effort -- no CDR, make up something */
char tmpid[256];
- snprintf(tmpid, sizeof(tmpid), "chan-%x", rand());
+ snprintf(tmpid, sizeof(tmpid), "chan-%lx", ast_random());
ast_monitor_start(which, qe->parent->monfmt, tmpid, 1 );
}
if (qe->parent->monjoin)