[Freeswitch-svn] [commit] r5539 - freeswitch/trunk/scripts/contrib/trixter
Author: trixter Date: Wed Jul 18 06:53:02 2007 New Revision: 5539 Added: freeswitch/trunk/scripts/contrib/trixter/newgcc-2.svndiff Log: another gcc patch to fix warnings Added: freeswitch/trunk/scripts/contrib/trixter/newgcc-2.svndiff ============================================================================== --- (empty file) +++ freeswitch/trunk/scripts/contrib/trixter/newgcc-2.svndiff Wed Jul 18 06:53:02 2007 @@ -0,0 +1,100 @@ +Index: src/switch.c +=================================================================== +--- src/switch.c (revision 5538) ++++ src/switch.c (working copy) +@@ -96,7 +96,9 @@ + } + + /* pull the pid from the file */ +- fscanf(f, "%d", &pid); ++ if(fscanf(f, "%d", &pid)!=1) { ++ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,"Unable to get the pid!\n"); ++ } + + /* if we have a valid pid */ + if (pid > 0) { +Index: src/mod/endpoints/mod_iax/mod_iax.c +=================================================================== +--- src/mod/endpoints/mod_iax/mod_iax.c (revision 5538) ++++ src/mod/endpoints/mod_iax/mod_iax.c (working copy) +@@ -278,8 +278,8 @@ + char pref_str[256] = "("; + + for (x = 0; x < len; x++) { +- strncat(pref_str, ast2str(prefs[x]), sizeof(pref_str)); +- strncat(pref_str, x == len - 1 ? ")" : ",", sizeof(pref_str)); ++ strncat(pref_str, ast2str(prefs[x]), sizeof(pref_str)-1); ++ strncat(pref_str, x == len - 1 ? ")" : ",", sizeof(pref_str)-1); + } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Codec Prefs Detected: %s\n", pref_str); +Index: src/mod/applications/mod_dptools/mod_dptools.c +=================================================================== +--- src/mod/applications/mod_dptools/mod_dptools.c (revision 5538) ++++ src/mod/applications/mod_dptools/mod_dptools.c (working copy) +@@ -724,7 +724,9 @@ + SWITCH_STANDARD_APP(system_session_function) + { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Executing command: %s\n",data); +- system(data); ++ if(!system(data)) { ++ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Failed to execute command: %s\n",data); ++ } + } + + SWITCH_STANDARD_APP(tone_detect_session_function) +Index: src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +=================================================================== +--- src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (revision 5538) ++++ src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (working copy) +@@ -783,7 +783,10 @@ + + if ((mods = switch_xml_child(cfg, "modules"))) { + for (ld = switch_xml_child(mods, "load"); ld; ld = ld->next) { +- const char *val = switch_xml_attr_soft(ld, "module"); ++ /* newer GCC doesnt like pasing val because it was a const, made it non-const which is potentially bad ++ * but that happens anyway when it goes to sm_load_module ++ */ ++ char *val = (char *)switch_xml_attr_soft(ld, "module"); + if (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Invalid extension for %s\n", val); + continue; +@@ -1527,6 +1530,11 @@ + + CHANNEL_SANITY_CHECK(); + ++ if (argc < 3) { ++ *rval = BOOLEAN_TO_JSVAL(JS_FALSE); ++ return JS_FALSE; ++ } ++ + if (argc > 0) { + tts_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0])); + } +@@ -1964,7 +1972,9 @@ + register unsigned int realsize = (unsigned int) (size * nmemb); + struct config_data *config_data = data; + +- write(config_data->fd, ptr, realsize); ++ if(write(config_data->fd, ptr, realsize)!=realsize) { ++ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to write all bytes!\n"); ++ } + return realsize; + } + +Index: src/mod/languages/mod_spidermonkey_etpan/mod_spidermonkey_etpan.c +=================================================================== +--- src/mod/languages/mod_spidermonkey_etpan/mod_spidermonkey_etpan.c (revision 5538) ++++ src/mod/languages/mod_spidermonkey_etpan/mod_spidermonkey_etpan.c (working copy) +@@ -180,7 +180,10 @@ + close(ifd); + } + snprintf(buf, B64BUFFLEN, "/bin/cat %s | /usr/sbin/sendmail -tf \"%s\" %s", filename, from, to); +- system(buf); ++ if(!system(buf)) { ++ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to execute command: %s\n",buf); ++ } ++ + unlink(filename); + +
participants (1)
-
Freeswitch SVN