diff options
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_dahdi.c | 14 | ||||
-rw-r--r-- | channels/chan_h323.c | 2 | ||||
-rw-r--r-- | channels/chan_iax2.c | 13 | ||||
-rw-r--r-- | channels/chan_oss.c | 13 | ||||
-rw-r--r-- | channels/chan_sip.c | 5 |
5 files changed, 32 insertions, 15 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index fc4863a4e..a24ed5fa7 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -10356,8 +10356,11 @@ static void dahdi_pri_message(struct pri *pri, char *s) ast_mutex_lock(&pridebugfdlock); - if (pridebugfd >= 0) - write(pridebugfd, s, strlen(s)); + if (pridebugfd >= 0) { + if (write(pridebugfd, s, strlen(s)) < 0) { + ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno)); + } + } ast_mutex_unlock(&pridebugfdlock); } @@ -10392,8 +10395,11 @@ static void dahdi_pri_error(struct pri *pri, char *s) ast_mutex_lock(&pridebugfdlock); - if (pridebugfd >= 0) - write(pridebugfd, s, strlen(s)); + if (pridebugfd >= 0) { + if (write(pridebugfd, s, strlen(s)) < 0) { + ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno)); + } + } ast_mutex_unlock(&pridebugfdlock); } diff --git a/channels/chan_h323.c b/channels/chan_h323.c index c2aaa2a6c..cd6ca8e5f 100644 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -1246,7 +1246,7 @@ static struct oh323_alias *realtime_alias(const char *alias) static int update_common_options(struct ast_variable *v, struct call_options *options) { - int tmp; + int tmp = 0; char *val, *opt; if (!strcasecmp(v->name, "allow")) { diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index adf4fa6f4..3851d8ead 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -6717,8 +6717,10 @@ static int complete_dpreply(struct chan_iax2_pvt *pvt, struct iax_ies *ies) } /* Wake up waiters */ for (x = 0; x < ARRAY_LEN(dp->waiters); x++) { - if (dp->waiters[x] > -1) - write(dp->waiters[x], "asdf", 4); + if (dp->waiters[x] > -1) { + if (write(dp->waiters[x], "asdf", 4) < 0) { + } + } } } AST_LIST_TRAVERSE_SAFE_END; @@ -11782,8 +11784,11 @@ static struct iax2_dpcache *find_cache(struct ast_channel *chan, const char *dat systems without leaving it unavailable once the server comes back online */ dp->expiry.tv_sec = dp->orig.tv_sec + 60; for (x = 0; x < ARRAY_LEN(dp->waiters); x++) { - if (dp->waiters[x] > -1) - write(dp->waiters[x], "asdf", 4); + if (dp->waiters[x] > -1) { + if (write(dp->waiters[x], "asdf", 4) < 0) { + ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno)); + } + } } } } diff --git a/channels/chan_oss.c b/channels/chan_oss.c index ddaa2efde..186e3a2a6 100644 --- a/channels/chan_oss.c +++ b/channels/chan_oss.c @@ -1382,10 +1382,15 @@ static struct chan_oss_pvt *store_config(struct ast_config *cfg, char *ctg) if (o->mixer_cmd) { char *cmd; - asprintf(&cmd, "mixer %s", o->mixer_cmd); - ast_log(LOG_WARNING, "running [%s]\n", cmd); - system(cmd); - ast_free(cmd); + if (asprintf(&cmd, "mixer %s", o->mixer_cmd) < 0) { + ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno)); + } else { + ast_log(LOG_WARNING, "running [%s]\n", cmd); + if (system(cmd) < 0) { + ast_log(LOG_WARNING, "system() failed: %s\n", strerror(errno)); + } + ast_free(cmd); + } } /* if the config file requested to start the GUI, do it */ diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 5d04495d1..d1cb709fd 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -22076,8 +22076,9 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str if (!ast_strlen_zero(callback)) { /* build string from peer info */ char *reg_string; - asprintf(®_string, "%s:%s@%s/%s", peer->username, peer->secret, peer->tohost, callback); - if (reg_string) { + if (asprintf(®_string, "%s:%s@%s/%s", peer->username, peer->secret, peer->tohost, callback) < 0) { + ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno)); + } else if (reg_string) { sip_register(reg_string, 0); /* XXX TODO: count in registry_count */ ast_free(reg_string); } |