Skip to content
Snippets Groups Projects
Commit e7c88e11 authored by Richard Mudgett's avatar Richard Mudgett
Browse files

sched.c: Make not return a sched id of 0.

According to the API doxygen a sched ID of 0 is valid.  Unfortunately, 0
was never returned historically and several users incorrectly coded usage
of the returned sched ID assuming that 0 was invalid.

ASTERISK-25476

Change-Id: Ib19c7ebb44ec9fd393ef6646dea806d4f34e3a20
parent 4aed349a
No related branches found
No related tags found
No related merge requests found
......@@ -315,9 +315,16 @@ static int add_ids(struct ast_sched_context *con)
if (!new_id) {
break;
}
new_id->id = i;
/*
* According to the API doxygen a sched ID of 0 is valid.
* Unfortunately, 0 was never returned historically and
* several users incorrectly coded usage of the returned
* sched ID assuming that 0 was invalid.
*/
new_id->id = ++con->id_queue_size;
AST_LIST_INSERT_TAIL(&con->id_queue, new_id, list);
++con->id_queue_size;
}
return con->id_queue_size - original_size;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment