aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_dahdi.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-01 18:22:39 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-01 18:22:39 +0000
commitea96823f2626e2a4178eec54f8a78a666d376ac1 (patch)
treed6fd63606de3355d2e0f7bb2ab751116095a1451 /channels/chan_dahdi.c
parent1c4fdfd503883d806ba05da5d0e9156b54a4d51b (diff)
fix a bunch of potential problems found by gcc 4.3.x, primarily bare strings being passed to printf()-like functions and ignored results from read()/write() and friends
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@153337 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r--channels/chan_dahdi.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index e3d73ac3f..4a26f6d36 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -8379,8 +8379,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);
}
@@ -8418,8 +8421,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);
}