aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-03 00:39:04 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-03 00:39:04 +0000
commitd3d057390c26ce35b54750705377c4d3ff4e42bd (patch)
treea04b5ab1a5d778cb8c4239d8cac88ef1a5ebba5d /pbx
parent9a2130e9dec6e913af3b75006c23feb0520d6814 (diff)
port gcc 4.3.x warning fixes from trunk to this branch
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@153743 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r--pbx/pbx_config.c10
-rw-r--r--pbx/pbx_dundi.c9
-rw-r--r--pbx/pbx_lua.c4
3 files changed, 18 insertions, 5 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index b63fedd1e..dc4813639 100644
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -491,10 +491,16 @@ static char *complete_dialplan_remove_extension(struct ast_cli_args *a)
if (++which > a->n) {
/* If there is an extension then return exten@context. */
if (ast_get_extension_matchcid(e) && (!strchr(a->word, '@') || strchr(a->word, '/'))) {
- asprintf(&ret, "%s/%s@%s", ast_get_extension_name(e), ast_get_extension_cidmatch(e), ast_get_context_name(c));
+ if (asprintf(&ret, "%s/%s@%s", ast_get_extension_name(e), ast_get_extension_cidmatch(e), ast_get_context_name(c)) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ ret = NULL;
+ }
break;
} else if (!ast_get_extension_matchcid(e) && !strchr(a->word, '/')) {
- asprintf(&ret, "%s@%s", ast_get_extension_name(e), ast_get_context_name(c));
+ if (asprintf(&ret, "%s@%s", ast_get_extension_name(e), ast_get_context_name(c)) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ ret = NULL;
+ }
break;
}
}
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c
index 474012776..cf214dc31 100644
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -3002,7 +3002,9 @@ static void destroy_trans(struct dundi_transaction *trans, int fromtimeout)
if (AST_LIST_EMPTY(&trans->parent->trans)) {
/* Wake up sleeper */
if (trans->parent->pfds[1] > -1) {
- write(trans->parent->pfds[1], "killa!", 6);
+ if (write(trans->parent->pfds[1], "killa!", 6) < 0) {
+ ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno));
+ }
}
}
}
@@ -3769,7 +3771,10 @@ static int dundi_precache_internal(const char *context, const char *number, int
dr.expiration = dundi_cache_time;
dr.hmd = &hmd;
dr.pfds[0] = dr.pfds[1] = -1;
- pipe(dr.pfds);
+ if (pipe(dr.pfds) < 0) {
+ ast_log(LOG_WARNING, "pipe() failed: %s\n", strerror(errno));
+ return -1;
+ }
build_transactions(&dr, ttl, 0, &foundcache, &skipped, 0, 1, 1, NULL, avoids, NULL);
optimize_transactions(&dr, 0);
foundanswers = 0;
diff --git a/pbx/pbx_lua.c b/pbx/pbx_lua.c
index b715a3b5f..6a600a4ae 100644
--- a/pbx/pbx_lua.c
+++ b/pbx/pbx_lua.c
@@ -946,7 +946,9 @@ static char *lua_read_extensions_file(lua_State *L, long *size)
return NULL;
}
- fread(data, sizeof(char), *size, f);
+ if (fread(data, sizeof(char), *size, f) != *size) {
+ ast_log(LOG_WARNING, "fread() failed: %s\n", strerror(errno));
+ }
fclose(f);
if (luaL_loadbuffer(L, data, *size, "extensions.lua")