diff --git a/src/log.c b/src/log.c index b4a1cdc..4a01265 100644 --- a/src/log.c +++ b/src/log.c @@ -232,6 +232,11 @@ static void output_to_stderr(const char *label, va_list ap, char *file, if (!log_to_stderr) return; sts = gettimeofday(&tv, NULL); + if (sts != 0) { + tv.tv_sec=0; + tv.tv_usec=0; + } + tim = localtime(&(tv.tv_sec)); fprintf(stderr, "%2.2i:%2.2i:%2.2i.%3.3i %s%s:%i ", tim->tm_hour, tim->tm_min, tim->tm_sec, @@ -267,6 +272,10 @@ static void output_to_TCP(const char *label, va_list ap, char *file, if (debug_fd <= 0) return; sts = gettimeofday(&tv, NULL); + if (sts != 0) { + tv.tv_sec=0; + tv.tv_usec=0; + } tim = localtime(&(tv.tv_sec)); snprintf(outbuf, sizeof(outbuf), "%2.2i:%2.2i:%2.2i.%3.3i %s%s:%i ", tim->tm_hour, tim->tm_min, tim->tm_sec, @@ -374,6 +383,9 @@ void log_dump_buffer(unsigned int class, char *file, int line, if (debug_fd > 0) { snprintf(outbuf, sizeof(outbuf) ,"---BUFFER DUMP follows---\n"); sts=write(debug_fd, outbuf, strlen(outbuf)); + if (sts < 0) { + ERROR("write returned error [%i:%s]",errno, strerror(errno)); + } } for (i=0; i 0) { snprintf(outbuf, sizeof(outbuf) ,"---end of BUFFER DUMP---\n"); sts=write(debug_fd, outbuf, strlen(outbuf)); + if (sts < 0) { + ERROR("write returned error [%i:%s]",errno, strerror(errno)); + } } pthread_mutex_unlock(&log_mutex); diff --git a/src/plugin_codecfilter.c b/src/plugin_codecfilter.c index e65ce62..2d2a6f9 100644 --- a/src/plugin_codecfilter.c +++ b/src/plugin_codecfilter.c @@ -258,6 +258,9 @@ static int sdp_filter_codec(sdp_message_t *sdp) { // fetch the media type value (first number field in value) attr_mediatype=0; sts=sscanf(sdp_attr->a_att_value, "%i", &attr_mediatype); + if (sts == 0) { + DEBUGC(DBCLASS_PLUGIN, "parsing SDP attribute mediatype failed"); + } DEBUGC(DBCLASS_PLUGIN, " +--Attr field=%s, val=%s [MT=%i]", sdp_attr->a_att_field, sdp_attr->a_att_value, attr_mediatype); diff --git a/src/register.c b/src/register.c index d7de0ce..44219d1 100644 --- a/src/register.c +++ b/src/register.c @@ -55,9 +55,8 @@ extern int errno; void register_init(void) { FILE *stream; int sts, i; -// size_t len; char buff[128]; - char *c; +// char *c; memset(urlmap, 0, sizeof(urlmap)); @@ -75,14 +74,14 @@ void register_init(void) { /* read the url table from file */ DEBUGC(DBCLASS_REG,"loading registration table"); for (i=0;i < URLMAP_SIZE; i++) { - c=fgets(buff, sizeof(buff), stream); + fgets(buff, sizeof(buff), stream); sts=sscanf(buff, "****:%i:%i", &urlmap[i].active, &urlmap[i].expires); if (sts == 0) break; /* format error */ if (urlmap[i].active) { #define R(X) {\ sts=osip_uri_init(&X); \ if (sts == 0) { \ - c=fgets(buff, sizeof(buff), stream);\ + fgets(buff, sizeof(buff), stream);\ buff[sizeof(buff)-1]='\0';\ if (strchr(buff, 10)) *strchr(buff, 10)='\0';\ if (strchr(buff, 13)) *strchr(buff, 13)='\0';\ diff --git a/src/rtpproxy_relay.c b/src/rtpproxy_relay.c index e86d9b2..f87dd99 100644 --- a/src/rtpproxy_relay.c +++ b/src/rtpproxy_relay.c @@ -1025,6 +1025,9 @@ static void rtpproxy_kill( void ) { sts = rtp_relay_stop_fwd(&cid, rtp_proxytable[i].direction, rtp_proxytable[i].media_stream_no, LOCK_FDSET); + if (sts != STS_SUCCESS) { + DEBUGC(DBCLASS_RTP,"rtp_relay_stop_fwd did return error"); + } } } diff --git a/src/sip_utils.c b/src/sip_utils.c index 9051d8b..32fe13b 100644 --- a/src/sip_utils.c +++ b/src/sip_utils.c @@ -615,7 +615,6 @@ int sip_add_myvia (sip_ticket_t *ticket, int interface) { */ int sip_del_myvia (sip_ticket_t *ticket) { osip_via_t *via; - int sts; DEBUGC(DBCLASS_PROXY,"deleting topmost VIA"); via = osip_list_get (&(ticket->sipmsg->vias), 0); @@ -630,7 +629,7 @@ int sip_del_myvia (sip_ticket_t *ticket) { return STS_FAILURE; } - sts = osip_list_remove(&(ticket->sipmsg->vias), 0); + osip_list_remove(&(ticket->sipmsg->vias), 0); osip_via_free (via); return STS_SUCCESS; }