[Mon-devel] mon and -w
Brought to you by:
trockij
From: Ed R. <er...@pa...> - 2005-02-17 22:18:10
|
On Thu, Feb 17, 2005 at 03:54:25PM -0500, David Nolan wrote: > Ah, the wonder and curse of -w. It finds certain classes of bugs, and > actually helps you avoid exercising certain memory leaks in perl, but it > also whines about many things. I turned on -w in Mon to test a few things - here's a few fixes: @@ -156,7 +156,7 @@ # my $i; # loop iteration counter, used for debugging only my $lasttm; # the last time(2) the mon loop started -my $pid_file_owner; # set when creating pid file +my $pid_file_owner= 0; # set when creating pid file my $tm; # used in main loop # @@ -1064,7 +1064,7 @@ } elsif ($1 eq "dtlogging") { $new_CF{"DTLOGGING"} = 0; - if ($2 == 1 || $2 eq "yes" || $2 eq "true") { + if ($2 eq "yes" || $2 eq "true" || $2 == 1) { $new_CF{"DTLOGGING"} = 1; } @@ -4180,7 +4180,7 @@ my $trap_name = $1; my $trap_val = $2; chomp $trap_val; - $trap_val =~ s/^\'(.*)\'$/\1/; + $trap_val =~ s/^\'(.*)\'$/$1/; $trap{$trap_name} = un_esc_str ($trap_val); } -------------------------------------------------- And these things provoked "use of unitialized value" complaints, but I don't have any easy fixes: 3204 if ($sref->{"depend"} ne "" && 3205 $sref->{"dep_behavior"} eq "a") 5180 if (defined $sref->{"depend"} && $sref->{"dep_behavior"} eq $deptype) { 5181 $depend = $sref->{"depend"}; Though it might be too much work (without much point) to get mon to run under -w all the time, occasional checks like this might turn up problems that are waiting to happen. |