[asterisk-dev] [asterisk-commits] tilghman: trunk r221920 - /trunk/main/logger.c

Kevin P. Fleming kpfleming at digium.com
Fri Oct 2 07:15:12 CDT 2009


SVN commits to the Asterisk project wrote:
> Author: tilghman
> Date: Thu Oct  1 22:04:34 2009
> New Revision: 221920
> 
> URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=221920
> Log:
> Initialize a variable that we check immediately upon startup.
> (closes issue #15973)
>  Reported by: atis
> 
> Modified:
>     trunk/main/logger.c
> 
> Modified: trunk/main/logger.c
> URL: http://svnview.digium.com/svn/asterisk/trunk/main/logger.c?view=diff&rev=221920&r1=221919&r2=221920
> ==============================================================================
> --- trunk/main/logger.c (original)
> +++ trunk/main/logger.c Thu Oct  1 22:04:34 2009
> @@ -139,7 +139,7 @@
>  static AST_LIST_HEAD_STATIC(logmsgs, logmsg);
>  static pthread_t logthread = AST_PTHREADT_NULL;
>  static ast_cond_t logcond;
> -static int close_logger_thread;
> +static int close_logger_thread = 0;

This should not be necessary; by specification in the C standards,
static module-scope variables are always initialized to zero unless an
initializer is provided. If valgrind is reporting that this variable is
accessed without being initialized, it is in error.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kpfleming at digium.com
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list