diff options
author | Walter Doekes <walter+asterisk@wjd.nu> | 2012-02-08 20:49:48 +0000 |
---|---|---|
committer | Walter Doekes <walter+asterisk@wjd.nu> | 2012-02-08 20:49:48 +0000 |
commit | db24fc2523da16bd812abb2a35b6320d24083e3f (patch) | |
tree | 4f4d564d4c32538014aefd01789f3f2bffc5520e /main/udptl.c | |
parent | 0adeb88318467f75f84a70990b1f982b9ca470f3 (diff) |
Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: Clod Patry
Review: https://reviewboard.asterisk.org/r/1651
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/udptl.c')
-rw-r--r-- | main/udptl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/main/udptl.c b/main/udptl.c index 943cd286a..be5fff10d 100644 --- a/main/udptl.c +++ b/main/udptl.c @@ -1045,7 +1045,6 @@ int ast_udptl_write(struct ast_udptl *s, struct ast_frame *f) { unsigned int seq; unsigned int len = f->datalen; - int res; /* if no max datagram size is provided, use default value */ const int bufsize = (s->far_max_datagram > 0) ? s->far_max_datagram : DEFAULT_FAX_MAX_DATAGRAM; uint8_t buf[bufsize]; @@ -1083,12 +1082,14 @@ int ast_udptl_write(struct ast_udptl *s, struct ast_frame *f) len = udptl_build_packet(s, buf, sizeof(buf), f->data.ptr, len); if ((signed int) len > 0 && !ast_sockaddr_isnull(&s->them)) { - if ((res = ast_sendto(s->fd, buf, len, 0, &s->them)) < 0) + if (ast_sendto(s->fd, buf, len, 0, &s->them) < 0) { ast_log(LOG_NOTICE, "UDPTL (%s): Transmission error to %s: %s\n", LOG_TAG(s), ast_sockaddr_stringify(&s->them), strerror(errno)); - if (udptl_debug_test_addr(&s->them)) + } + if (udptl_debug_test_addr(&s->them)) { ast_verb(1, "UDPTL (%s): packet to %s (seq %d, len %d)\n", LOG_TAG(s), ast_sockaddr_stringify(&s->them), seq, len); + } } return 0; |