summaryrefslogtreecommitdiff
path: root/res/res_parking.c
diff options
context:
space:
mode:
authorzuul <zuul@gerrit.asterisk.org>2016-03-29 08:53:45 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-03-29 08:53:45 -0500
commit3528a9a42e82d1fd6e07ef0b591fa3c81baec3fb (patch)
treedce45931b2240badad42e3c1e3316d5b08f329a4 /res/res_parking.c
parentc88c09a9204544c8d903ef333ba9bbeb3c8cd692 (diff)
parenta4189763ab562ee2e8e79fda60b213ee90aab6f1 (diff)
Merge "res_parking: Misc fixes." into 13
Diffstat (limited to 'res/res_parking.c')
-rw-r--r--res/res_parking.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/res/res_parking.c b/res/res_parking.c
index eb47d9b08..fbe256c93 100644
--- a/res/res_parking.c
+++ b/res/res_parking.c
@@ -782,31 +782,21 @@ int parking_lot_cfg_create_extensions(struct parking_lot_cfg *lot_cfg)
}
/* We need the contexts list locked to safely be able to both read and lock the specific context within */
- if (ast_wrlock_contexts()) {
- ast_log(LOG_ERROR, "Failed to lock the contexts list.\n");
- return -1;
- }
+ ast_wrlock_contexts();
if (!(lot_context = ast_context_find_or_create(NULL, NULL, lot_cfg->parking_con, parkext_registrar_pointer))) {
ast_log(LOG_ERROR, "Parking lot '%s' -- Needs a context '%s' which does not exist and Asterisk was unable to create\n",
lot_cfg->name, lot_cfg->parking_con);
- if (ast_unlock_contexts()) {
- ast_assert(0);
- }
+ ast_unlock_contexts();
return -1;
}
/* Once we know what context we will be modifying, we need to write lock it because we will be reading extensions
* and we don't want something else to destroy them while we are looking at them.
*/
- if (ast_wrlock_context(lot_context)) {
- ast_log(LOG_ERROR, "failed to obtain write lock on context\n");
- return -1;
- }
+ ast_wrlock_context(lot_context);
- if (ast_unlock_contexts()) {
- ast_assert(0);
- }
+ ast_unlock_contexts();
/* Handle generation/confirmation for the Park extension */
if ((existing_exten = pbx_find_extension(NULL, NULL, &find_info, lot_cfg->parking_con, lot_cfg->parkext, 1, NULL, NULL, E_MATCH))) {
@@ -874,9 +864,7 @@ int parking_lot_cfg_create_extensions(struct parking_lot_cfg *lot_cfg)
}
}
- if (ast_unlock_context(lot_context)) {
- ast_assert(0);
- }
+ ast_unlock_context(lot_context);
return 0;
}