summaryrefslogtreecommitdiff
path: root/pbx
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2008-11-02 18:52:13 +0000
committerKevin P. Fleming <kpfleming@digium.com>2008-11-02 18:52:13 +0000
commitbd4eb070f3b292617be20bda069cac47df2f7495 (patch)
treea3750d996d41e35c5df34c29533dd7d9fdcaff24 /pbx
parent1e6864dd9d894db29ebc350b015e9eb58226a021 (diff)
bring over all the fixes for the warnings found by gcc 4.3.x from the 1.4 branch, and add the ones needed for all the new code here too
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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 2899ec1a7..84fa564ae 100644
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -492,10 +492,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 5d3a0be12..12ab1328d 100644
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -2958,7 +2958,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));
+ }
}
}
}
@@ -3725,7 +3727,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 ba6a7c456..7bc1a8ad1 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")