On Jun 1, 2010, at 2:29 PM, Mark Martinec wrote:

> Here's one trivial fix I committed to 3.3 and to trunk to avoid a warning
> when starting spamd:
>  warn: Use of uninitialized value $opt{"syslog-socket"} in lc at 
> /usr/local/bin/spamd line 444.
> 
> It's a trivial one, not worth making a fuss about in bugzilla,
> I just wanted to let you know what it's all about:
> 
> 
> --- spamd/spamd.raw   (revision 950094)
> +++ spamd/spamd.raw   (working copy)
> @@ -443,10 +443,12 @@
> #  socket of 'none' means as much as --syslog=null. Sounds complicated? It is.
> #  But it works.
> # )
> -my $log_socket = lc($opt{'syslog-socket'});
> +my $log_socket = $opt{'syslog-socket'};
> 
> if (!defined $log_socket || $log_socket eq '') {
>   $log_socket = am_running_on_windows() ? 'none' : 'unix';
> +} else {
> +  $log_socket = lc $log_socket;
> }
> 
> # This is the default log file; it can be changed on the command line
> 
> 
> 
> Mark

This will actually cause warnings under perl 5.12, since perl 5.12 now warns 
you that undef was passed to lc. It'll still return an empty string but may 
cause allot of warnings. These warnings have just been cleaned out of the 3.3 
branch, so I hate to see one go back in. I would suggest ...

$log_socket = $log_socket || '';

instead of

$log_socket = lc $log_socket;

It's more explicit about what you're trying to do anyway. In fact, not knowing 
the code, 0 might be a better choice than an empty string?

Todd

Reply via email to