aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_dahdi.c
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 /channels/chan_dahdi.c
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 'channels/chan_dahdi.c')
-rw-r--r--channels/chan_dahdi.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 6c1e4f4d1..bf75d8371 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -10079,8 +10079,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);
}
@@ -10115,8 +10118,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);
}
@@ -11417,7 +11423,9 @@ static char *complete_span_helper(const char *line, const char *word, int pos, i
for (which = span = 0; span < NUM_SPANS; span++) {
if (pris[span].pri && ++which > state) {
- asprintf(&ret, "%d", span + 1); /* user indexes start from 1 */
+ if (asprintf(&ret, "%d", span + 1) < 0) { /* user indexes start from 1 */
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ }
break;
}
}