[asterisk-commits] kpfleming: branch 1.6.0 r153743 - in /branches/1.6.0: agi/ apps/ channels/ fo...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Nov 2 18:39:05 CST 2008
Author: kpfleming
Date: Sun Nov 2 18:39:04 2008
New Revision: 153743
URL: http://svn.digium.com/view/asterisk?view=rev&rev=153743
Log:
port gcc 4.3.x warning fixes from trunk to this branch
Modified:
branches/1.6.0/agi/eagi-sphinx-test.c
branches/1.6.0/agi/eagi-test.c
branches/1.6.0/apps/app_adsiprog.c
branches/1.6.0/apps/app_authenticate.c
branches/1.6.0/apps/app_chanspy.c
branches/1.6.0/apps/app_dial.c
branches/1.6.0/apps/app_festival.c
branches/1.6.0/apps/app_queue.c
branches/1.6.0/apps/app_sms.c
branches/1.6.0/apps/app_stack.c
branches/1.6.0/apps/app_voicemail.c
branches/1.6.0/channels/chan_dahdi.c
branches/1.6.0/channels/chan_h323.c
branches/1.6.0/channels/chan_iax2.c
branches/1.6.0/channels/chan_oss.c
branches/1.6.0/channels/chan_sip.c
branches/1.6.0/formats/format_gsm.c
branches/1.6.0/formats/format_ogg_vorbis.c
branches/1.6.0/formats/format_wav.c
branches/1.6.0/formats/format_wav_gsm.c
branches/1.6.0/funcs/func_odbc.c
branches/1.6.0/main/ast_expr2f.c
branches/1.6.0/main/asterisk.c
branches/1.6.0/main/channel.c
branches/1.6.0/main/db1-ast/hash/hash_page.c
branches/1.6.0/main/file.c
branches/1.6.0/main/http.c
branches/1.6.0/main/logger.c
branches/1.6.0/main/manager.c
branches/1.6.0/main/utils.c
branches/1.6.0/pbx/pbx_config.c
branches/1.6.0/pbx/pbx_dundi.c
branches/1.6.0/pbx/pbx_lua.c
branches/1.6.0/res/ael/ael.flex
branches/1.6.0/res/ael/ael.tab.c
branches/1.6.0/res/ael/ael.y
branches/1.6.0/res/ael/ael_lex.c
branches/1.6.0/res/res_agi.c
branches/1.6.0/res/res_crypto.c
branches/1.6.0/res/res_jabber.c
branches/1.6.0/res/res_musiconhold.c
branches/1.6.0/res/res_phoneprov.c
branches/1.6.0/utils/astcanary.c
branches/1.6.0/utils/astman.c
branches/1.6.0/utils/frame.c
branches/1.6.0/utils/muted.c
branches/1.6.0/utils/stereorize.c
branches/1.6.0/utils/streamplayer.c
Modified: branches/1.6.0/agi/eagi-sphinx-test.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/agi/eagi-sphinx-test.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/agi/eagi-sphinx-test.c (original)
+++ branches/1.6.0/agi/eagi-sphinx-test.c Sun Nov 2 18:39:04 2008
@@ -79,7 +79,9 @@
char *val;
/* Read environment */
for(;;) {
- fgets(buf, sizeof(buf), stdin);
+ if (!fgets(buf, sizeof(buf), stdin)) {
+ return -1;
+ }
if (feof(stdin))
return -1;
buf[strlen(buf) - 1] = '\0';
@@ -130,7 +132,9 @@
return NULL;
}
if (FD_ISSET(STDIN_FILENO, &fds)) {
- fgets(astresp, sizeof(astresp), stdin);
+ if (!fgets(astresp, sizeof(astresp), stdin)) {
+ return NULL;
+ }
if (feof(stdin)) {
fprintf(stderr, "Got hungup on apparently\n");
return NULL;
@@ -141,9 +145,10 @@
}
if (FD_ISSET(AUDIO_FILENO, &fds)) {
res = read(AUDIO_FILENO, audiobuf, sizeof(audiobuf));
- if (res > 0) {
- if (sphinx_sock > -1)
- write(sphinx_sock, audiobuf, res);
+ if ((res > 0) && (sphinx_sock > -1)) {
+ if (write(sphinx_sock, audiobuf, res) < 0) {
+ fprintf(stderr, "write() failed: %s\n", strerror(errno));
+ }
}
}
if ((sphinx_sock > -1) && FD_ISSET(sphinx_sock, &fds)) {
Modified: branches/1.6.0/agi/eagi-test.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/agi/eagi-test.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/agi/eagi-test.c (original)
+++ branches/1.6.0/agi/eagi-test.c Sun Nov 2 18:39:04 2008
@@ -24,7 +24,9 @@
char *val;
/* Read environment */
for(;;) {
- fgets(buf, sizeof(buf), stdin);
+ if (!fgets(buf, sizeof(buf), stdin)) {
+ return -1;
+ }
if (feof(stdin))
return -1;
buf[strlen(buf) - 1] = '\0';
@@ -68,7 +70,9 @@
return NULL;
}
if (FD_ISSET(STDIN_FILENO, &fds)) {
- fgets(astresp, sizeof(astresp), stdin);
+ if (!fgets(astresp, sizeof(astresp), stdin)) {
+ return NULL;
+ }
if (feof(stdin)) {
fprintf(stderr, "Got hungup on apparently\n");
return NULL;
Modified: branches/1.6.0/apps/app_adsiprog.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_adsiprog.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/apps/app_adsiprog.c (original)
+++ branches/1.6.0/apps/app_adsiprog.c Sun Nov 2 18:39:04 2008
@@ -1369,7 +1369,9 @@
/* Create "main" as first subroutine */
getsubbyname(scr, "main", NULL, 0);
while (!feof(f)) {
- fgets(buf, sizeof(buf), f);
+ if (!fgets(buf, sizeof(buf), f)) {
+ continue;
+ }
if (!feof(f)) {
lineno++;
/* Trim off trailing return */
Modified: branches/1.6.0/apps/app_authenticate.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_authenticate.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/apps/app_authenticate.c (original)
+++ branches/1.6.0/apps/app_authenticate.c Sun Nov 2 18:39:04 2008
@@ -151,7 +151,9 @@
if (feof(f))
break;
- fgets(buf, sizeof(buf), f);
+ if (!fgets(buf, sizeof(buf), f)) {
+ continue;
+ }
if (ast_strlen_zero(buf))
continue;
Modified: branches/1.6.0/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_chanspy.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/apps/app_chanspy.c (original)
+++ branches/1.6.0/apps/app_chanspy.c Sun Nov 2 18:39:04 2008
@@ -34,6 +34,7 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <ctype.h>
+#include <errno.h>
#include "asterisk/paths.h" /* use ast_config_AST_MONITOR_DIR */
#include "asterisk/file.h"
@@ -212,8 +213,11 @@
return -1;
}
- if (csth->fd)
- write(csth->fd, f->data, f->datalen);
+ if (csth->fd) {
+ if (write(csth->fd, f->data, f->datalen) < 0) {
+ ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno));
+ }
+ }
ast_frfree(f);
Modified: branches/1.6.0/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_dial.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/apps/app_dial.c (original)
+++ branches/1.6.0/apps/app_dial.c Sun Nov 2 18:39:04 2008
@@ -1762,10 +1762,16 @@
gosub_argstart = strchr(opt_args[OPT_ARG_CALLEE_GOSUB], ',');
if (gosub_argstart) {
*gosub_argstart = 0;
- asprintf(&gosub_args, "%s,s,1(%s)", opt_args[OPT_ARG_CALLEE_GOSUB], gosub_argstart + 1);
+ if (asprintf(&gosub_args, "%s,s,1(%s)", opt_args[OPT_ARG_CALLEE_GOSUB], gosub_argstart + 1) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ gosub_args = NULL;
+ }
*gosub_argstart = ',';
} else {
- asprintf(&gosub_args, "%s,s,1", opt_args[OPT_ARG_CALLEE_GOSUB]);
+ if (asprintf(&gosub_args, "%s,s,1", opt_args[OPT_ARG_CALLEE_GOSUB]) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ gosub_args = NULL;
+ }
}
if (gosub_args) {
Modified: branches/1.6.0/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_festival.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/apps/app_festival.c (original)
+++ branches/1.6.0/apps/app_festival.c Sun Nov 2 18:39:04 2008
@@ -38,6 +38,7 @@
#include <signal.h>
#include <fcntl.h>
#include <ctype.h>
+#include <errno.h>
#include "asterisk/file.h"
#include "asterisk/channel.h"
@@ -148,7 +149,11 @@
*(waveform + x) = c;
}
#endif
- write(fd, waveform, length);
+
+ if (write(fd, waveform, length) < 0) {
+ ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno));
+ }
+
close(fd);
exit(0);
}
@@ -421,17 +426,25 @@
writecache = 1;
strln = strlen(args.text);
ast_debug(1, "line length : %d\n", strln);
- write(fdesc, &strln, sizeof(strln));
- write(fdesc, args.text, strln);
+ if (write(fdesc,&strln,sizeof(int)) < 0) {
+ ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno));
+ }
+ if (write(fdesc,data,strln) < 0) {
+ ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno));
+ }
seekpos = lseek(fdesc, 0, SEEK_CUR);
ast_debug(1, "Seek position : %d\n", seekpos);
}
} else {
- read(fdesc, &strln, sizeof(strln));
+ if (read(fdesc,&strln,sizeof(int)) != sizeof(int)) {
+ ast_log(LOG_WARNING, "read() failed: %s\n", strerror(errno));
+ }
ast_debug(1, "Cache file exists, strln=%d, strlen=%d\n", strln, (int)strlen(args.text));
if (strlen(args.text) == strln) {
ast_debug(1, "Size OK\n");
- read(fdesc, &bigstring, strln);
+ if (read(fdesc,&bigstring,strln) != strln) {
+ ast_log(LOG_WARNING, "read() failed: %s\n", strerror(errno));
+ }
bigstring[strln] = 0;
if (strcmp(bigstring, args.text) == 0) {
readcache = 1;
@@ -461,7 +474,9 @@
if (writecache == 1) {
ast_debug(1, "Writing result to cache...\n");
while ((strln = read(fd, buffer, 16384)) != 0) {
- write(fdesc, buffer, strln);
+ if (write(fdesc,buffer,strln) < 0) {
+ ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno));
+ }
}
close(fd);
close(fdesc);
Modified: branches/1.6.0/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_queue.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/apps/app_queue.c (original)
+++ branches/1.6.0/apps/app_queue.c Sun Nov 2 18:39:04 2008
@@ -3750,10 +3750,16 @@
gosub_argstart = strchr(gosubexec, ',');
if (gosub_argstart) {
*gosub_argstart = 0;
- asprintf(&gosub_args, "%s,s,1(%s)", gosubexec, gosub_argstart + 1);
+ if (asprintf(&gosub_args, "%s,s,1(%s)", gosubexec, gosub_argstart + 1) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ gosub_args = NULL;
+ }
*gosub_argstart = '|';
} else {
- asprintf(&gosub_args, "%s,s,1", gosubexec);
+ if (asprintf(&gosub_args, "%s,s,1", gosubexec) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ gosub_args = NULL;
+ }
}
if (gosub_args) {
res = pbx_exec(qe->chan, app, gosub_args);
Modified: branches/1.6.0/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_sms.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/apps/app_sms.c (original)
+++ branches/1.6.0/apps/app_sms.c Sun Nov 2 18:39:04 2008
@@ -745,7 +745,9 @@
}
*p++ = '\n';
*p = 0;
- write(o, line, strlen(line));
+ if (write(o, line, strlen(line)) < 0) {
+ ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno));
+ }
close(o);
}
*h->oa = *h->da = h->udl = 0;
Modified: branches/1.6.0/apps/app_stack.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_stack.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/apps/app_stack.c (original)
+++ branches/1.6.0/apps/app_stack.c Sun Nov 2 18:39:04 2008
@@ -426,9 +426,15 @@
* call a Gosub for the CALLEE channel in Dial or Queue.
*/
if (argc == 5) {
- asprintf(&gosub_args, "%s,%s,%d(%s)", argv[1], argv[2], priority + 1, argv[4]);
+ if (asprintf(&gosub_args, "%s,%s,%d(%s)", argv[1], argv[2], priority + 1, argv[4]) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ gosub_args = NULL;
+ }
} else {
- asprintf(&gosub_args, "%s,%s,%d", argv[1], argv[2], priority + 1);
+ if (asprintf(&gosub_args, "%s,%s,%d", argv[1], argv[2], priority + 1) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ gosub_args = NULL;
+ }
}
if (gosub_args) {
Modified: branches/1.6.0/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_voicemail.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/apps/app_voicemail.c (original)
+++ branches/1.6.0/apps/app_voicemail.c Sun Nov 2 18:39:04 2008
@@ -4771,7 +4771,9 @@
f = fopen(fn2, "r");
if (f) {
while (!feof(f)) {
- fgets((char *)buf, sizeof(buf), f);
+ if (!fgets((char *)buf, sizeof(buf), f)) {
+ continue;
+ }
if (!feof(f)) {
char *stringp = NULL;
stringp = (char *)buf;
Modified: branches/1.6.0/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_dahdi.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/channels/chan_dahdi.c (original)
+++ branches/1.6.0/channels/chan_dahdi.c Sun Nov 2 18:39:04 2008
@@ -10079,8 +10079,11 @@
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 @@
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 @@
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;
}
}
Modified: branches/1.6.0/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_h323.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/channels/chan_h323.c (original)
+++ branches/1.6.0/channels/chan_h323.c Sun Nov 2 18:39:04 2008
@@ -1251,7 +1251,7 @@
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")) {
Modified: branches/1.6.0/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_iax2.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/channels/chan_iax2.c (original)
+++ branches/1.6.0/channels/chan_iax2.c Sun Nov 2 18:39:04 2008
@@ -6537,8 +6537,10 @@
}
/* 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;
@@ -11511,8 +11513,11 @@
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));
+ }
+ }
}
}
}
Modified: branches/1.6.0/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_oss.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/channels/chan_oss.c (original)
+++ branches/1.6.0/channels/chan_oss.c Sun Nov 2 18:39:04 2008
@@ -1375,10 +1375,15 @@
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 (o == &oss_default) /* we are done with the default */
return NULL;
Modified: branches/1.6.0/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_sip.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/channels/chan_sip.c (original)
+++ branches/1.6.0/channels/chan_sip.c Sun Nov 2 18:39:04 2008
@@ -20741,8 +20741,9 @@
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);
}
Modified: branches/1.6.0/formats/format_gsm.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/formats/format_gsm.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/formats/format_gsm.c (original)
+++ branches/1.6.0/formats/format_gsm.c Sun Nov 2 18:39:04 2008
@@ -126,7 +126,9 @@
int i;
fseeko(fs->f, 0, SEEK_END);
for (i=0; i< (offset - max) / GSM_FRAME_SIZE; i++) {
- fwrite(gsm_silence, 1, GSM_FRAME_SIZE, fs->f);
+ if (!fwrite(gsm_silence, 1, GSM_FRAME_SIZE, fs->f)) {
+ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
+ }
}
}
return fseeko(fs->f, offset, SEEK_SET);
Modified: branches/1.6.0/formats/format_ogg_vorbis.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/formats/format_ogg_vorbis.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/formats/format_ogg_vorbis.c (original)
+++ branches/1.6.0/formats/format_ogg_vorbis.c Sun Nov 2 18:39:04 2008
@@ -225,8 +225,12 @@
while (!tmp->eos) {
if (ogg_stream_flush(&tmp->os, &tmp->og) == 0)
break;
- fwrite(tmp->og.header, 1, tmp->og.header_len, s->f);
- fwrite(tmp->og.body, 1, tmp->og.body_len, s->f);
+ if (!fwrite(tmp->og.header, 1, tmp->og.header_len, s->f)) {
+ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
+ }
+ if (!fwrite(tmp->og.body, 1, tmp->og.body_len, s->f)) {
+ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
+ }
if (ogg_page_eos(&tmp->og))
tmp->eos = 1;
}
@@ -251,8 +255,12 @@
if (ogg_stream_pageout(&s->os, &s->og) == 0) {
break;
}
- fwrite(s->og.header, 1, s->og.header_len, f);
- fwrite(s->og.body, 1, s->og.body_len, f);
+ if (!fwrite(s->og.header, 1, s->og.header_len, f)) {
+ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
+ }
+ if (!fwrite(s->og.body, 1, s->og.body_len, f)) {
+ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
+ }
if (ogg_page_eos(&s->og)) {
s->eos = 1;
}
Modified: branches/1.6.0/formats/format_wav.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/formats/format_wav.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/formats/format_wav.c (original)
+++ branches/1.6.0/formats/format_wav.c Sun Nov 2 18:39:04 2008
@@ -329,8 +329,11 @@
char zero = 0;
struct wav_desc *fs = (struct wav_desc *)s->_private;
/* Pad to even length */
- if (fs->bytes & 0x1)
- fwrite(&zero, 1, 1, s->f);
+ if (fs->bytes & 0x1) {
+ if (!fwrite(&zero, 1, 1, s->f)) {
+ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
+ }
+ }
}
static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext)
Modified: branches/1.6.0/formats/format_wav_gsm.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/formats/format_wav_gsm.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/formats/format_wav_gsm.c (original)
+++ branches/1.6.0/formats/format_wav_gsm.c Sun Nov 2 18:39:04 2008
@@ -496,7 +496,9 @@
int i;
fseek(fs->f, 0, SEEK_END);
for (i=0; i< (offset - max) / MSGSM_FRAME_SIZE; i++) {
- fwrite(msgsm_silence, 1, MSGSM_FRAME_SIZE, fs->f);
+ if (!fwrite(msgsm_silence, 1, MSGSM_FRAME_SIZE, fs->f)) {
+ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
+ }
}
}
s->secondhalf = 0;
Modified: branches/1.6.0/funcs/func_odbc.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/funcs/func_odbc.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/funcs/func_odbc.c (original)
+++ branches/1.6.0/funcs/func_odbc.c Sun Nov 2 18:39:04 2008
@@ -592,6 +592,7 @@
{
const char *tmp;
int i;
+ int res;
if (!cfg || !catg) {
return EINVAL;
@@ -681,9 +682,13 @@
}
if ((tmp = ast_variable_retrieve(cfg, catg, "prefix")) && !ast_strlen_zero(tmp)) {
- asprintf((char **)&((*query)->acf->name), "%s_%s", tmp, catg);
+ if (asprintf((char **)&((*query)->acf->name), "%s_%s", tmp, catg) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ }
} else {
- asprintf((char **)&((*query)->acf->name), "ODBC_%s", catg);
+ if (asprintf((char **)&((*query)->acf->name), "ODBC_%s", catg) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ }
}
if (!((*query)->acf->name)) {
@@ -693,7 +698,10 @@
return ENOMEM;
}
- asprintf((char **)&((*query)->acf->syntax), "%s(<arg1>[...[,<argN>]])", (*query)->acf->name);
+ if (asprintf((char **)&((*query)->acf->syntax), "%s(<arg1>[...[,<argN>]])", (*query)->acf->name) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ (*query)->acf->syntax = NULL;
+ }
if (!((*query)->acf->syntax)) {
ast_free((char *)(*query)->acf->name);
@@ -704,29 +712,31 @@
}
(*query)->acf->synopsis = "Runs the referenced query with the specified arguments";
+
+ res = 0;
if (!ast_strlen_zero((*query)->sql_read) && !ast_strlen_zero((*query)->sql_write)) {
- asprintf((char **)&((*query)->acf->desc),
- "Runs the following query, as defined in func_odbc.conf, performing\n"
- "substitution of the arguments into the query as specified by ${ARG1},\n"
- "${ARG2}, ... ${ARGn}. When setting the function, the values are provided\n"
- "either in whole as ${VALUE} or parsed as ${VAL1}, ${VAL2}, ... ${VALn}.\n"
- "\nRead:\n%s\n\nWrite:\n%s\n",
- (*query)->sql_read,
- (*query)->sql_write);
+ res = asprintf((char **)&((*query)->acf->desc),
+ "Runs the following query, as defined in func_odbc.conf, performing\n"
+ "substitution of the arguments into the query as specified by ${ARG1},\n"
+ "${ARG2}, ... ${ARGn}. When setting the function, the values are provided\n"
+ "either in whole as ${VALUE} or parsed as ${VAL1}, ${VAL2}, ... ${VALn}.\n"
+ "\nRead:\n%s\n\nWrite:\n%s\n",
+ (*query)->sql_read,
+ (*query)->sql_write);
} else if (!ast_strlen_zero((*query)->sql_read)) {
- asprintf((char **)&((*query)->acf->desc),
- "Runs the following query, as defined in func_odbc.conf, performing\n"
- "substitution of the arguments into the query as specified by ${ARG1},\n"
- "${ARG2}, ... ${ARGn}. This function may only be read, not set.\n\nSQL:\n%s\n",
- (*query)->sql_read);
+ res = asprintf((char **)&((*query)->acf->desc),
+ "Runs the following query, as defined in func_odbc.conf, performing\n"
+ "substitution of the arguments into the query as specified by ${ARG1},\n"
+ "${ARG2}, ... ${ARGn}. This function may only be read, not set.\n\nSQL:\n%s\n",
+ (*query)->sql_read);
} else if (!ast_strlen_zero((*query)->sql_write)) {
- asprintf((char **)&((*query)->acf->desc),
- "Runs the following query, as defined in func_odbc.conf, performing\n"
- "substitution of the arguments into the query as specified by ${ARG1},\n"
- "${ARG2}, ... ${ARGn}. The values are provided either in whole as\n"
- "${VALUE} or parsed as ${VAL1}, ${VAL2}, ... ${VALn}.\n"
- "This function may only be set.\nSQL:\n%s\n",
- (*query)->sql_write);
+ res = asprintf((char **)&((*query)->acf->desc),
+ "Runs the following query, as defined in func_odbc.conf, performing\n"
+ "substitution of the arguments into the query as specified by ${ARG1},\n"
+ "${ARG2}, ... ${ARGn}. The values are provided either in whole as\n"
+ "${VALUE} or parsed as ${VAL1}, ${VAL2}, ... ${VALn}.\n"
+ "This function may only be set.\nSQL:\n%s\n",
+ (*query)->sql_write);
} else {
ast_free((char *)(*query)->acf->syntax);
ast_free((char *)(*query)->acf->name);
@@ -736,7 +746,13 @@
return EINVAL;
}
- if (! ((*query)->acf->desc)) {
+ if (res < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ (*query)->acf->desc = NULL;
+ }
+
+
+ if (!((*query)->acf->desc)) {
ast_free((char *)(*query)->acf->syntax);
ast_free((char *)(*query)->acf->name);
ast_free((*query)->acf);
Modified: branches/1.6.0/main/ast_expr2f.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/ast_expr2f.c?view=diff&rev=153743&r1=153742&r2=153743
==============================================================================
--- branches/1.6.0/main/ast_expr2f.c (original)
+++ branches/1.6.0/main/ast_expr2f.c Sun Nov 2 18:39:04 2008
@@ -11,7 +11,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 33
+#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -33,7 +33,7 @@
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
@@ -56,7 +56,6 @@
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@@ -87,6 +86,8 @@
#define UINT32_MAX (4294967295U)
#endif
+#endif /* ! C99 */
+
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -96,11 +97,12 @@
#else /* ! __cplusplus */
-#if __STDC__
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
#define YY_USE_CONST
-#endif /* __STDC__ */
+#endif /* defined (__STDC__) */
#endif /* ! __cplusplus */
#ifdef YY_USE_CONST
@@ -135,8 +137,6 @@
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
#define yy_flex_debug yyg->yy_flex_debug_r
-
-int ast_yylex_init (yyscan_t* scanner);
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
@@ -195,14 +195,9 @@
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
-typedef unsigned int yy_size_t;
+typedef size_t yy_size_t;
#endif
#ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -341,6 +336,1810 @@
typedef int yy_state_type;
#define yytext_ptr yytext_r
+static yyconst flex_int16_t yy_nxt[][256] =
+ {
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0
+ },
+
+ {
+ 7, 8, 8, 8, 8, 8, 8, 8, 8, 9,
+ 10, 8, 8, 9, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 9, 11, 12, 13, 14, 15, 16, 13,
+
+ 17, 18, 19, 20, 21, 22, 13, 23, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 25, 13,
+ 26, 27, 28, 29, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 8, 13, 8, 13, 13, 8, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 8, 30, 8, 8, 8, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13
+ },
+
+ {
+ 7, 8, 8, 8, 8, 8, 8, 8, 8, 9,
+ 10, 8, 8, 9, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 9, 11, 12, 13, 14, 15, 16, 13,
+ 17, 18, 19, 20, 21, 22, 13, 23, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 25, 13,
+ 26, 27, 28, 29, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 8, 13, 8, 13, 13, 8, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 8, 30, 8, 8, 8, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13
+ },
+
+ {
+ 7, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+
+ 31, 31, 31, 32, 31, 33, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31
+ },
+
+ {
+ 7, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 32, 31, 33, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31
+
+ },
+
+ {
+ 7, 34, 34, 34, 34, 34, 34, 34, 34, 35,
+ 35, 34, 34, 35, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 35, 35, 34, 34, 36, 35, 35, 34,
+ 35, 35, 35, 35, 34, 35, 34, 35, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 35, 34,
+ 35, 35, 35, 35, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 35, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34
+ },
+
+ {
+ 7, 34, 34, 34, 34, 34, 34, 34, 34, 35,
+ 35, 34, 34, 35, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 35, 35, 34, 34, 36, 35, 35, 34,
+
+ 35, 35, 35, 35, 34, 35, 34, 35, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 35, 34,
+ 35, 35, 35, 35, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 35, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
[... 4975 lines stripped ...]
More information about the asterisk-commits
mailing list