Move shm Memory debug statements to level 2.

This commit is contained in:
Isaac Connor 2021-04-10 15:35:24 -04:00
parent 60970673c7
commit da630f7534
3 changed files with 12 additions and 12 deletions

View File

@ -306,7 +306,7 @@ sub zmMemVerify {
Error("Shared data not valid for monitor $$monitor{Id}");
return undef;
} else {
Debug("Shared data appears valid for monitor $$monitor{Id}: $valid");
Debug(2, "Shared data appears valid for monitor $$monitor{Id}: $valid");
}
return !undef;

View File

@ -81,7 +81,7 @@ sub zmMemAttach {
return undef;
}
if ( defined($monitor->{MMapAddr}) ) {
Debug("zmMemAttach already attached at $monitor->{MMapAddr} for $$monitor{Id}");
Debug(2, "zmMemAttach already attached at $monitor->{MMapAddr} for $$monitor{Id}");
return !undef;
}
@ -168,11 +168,11 @@ sub zmMemPut {
}
sub zmMemClean {
Debug('Removing memory map files');
Debug(2, 'Removing memory map files');
my $mapPath = $Config{ZM_PATH_MAP}.'/zm.mmap.*';
foreach my $mapFile( glob( $mapPath ) ) {
( $mapFile ) = $mapFile =~ /^(.+)$/;
Debug("Removing memory map file '$mapFile'");
Debug(2, "Removing memory map file '$mapFile'");
unlink($mapFile);
}
}

View File

@ -151,14 +151,14 @@ sub zmMemPut
sub zmMemClean
{
Debug( "Removing shared memory\n" );
Debug(2, 'Removing shared memory');
# Find ZoneMinder shared memory
my $command = "ipcs -m | grep '^"
.substr( sprintf( "0x%x", hex($Config{ZM_SHM_KEY}) ), 0, -2 )
."'"
my $command = 'ipcs -m | grep \'^'
.substr( sprintf( '0x%x', hex($Config{ZM_SHM_KEY}) ), 0, -2 )
.'\''
;
Debug( "Checking for shared memory with '$command'\n" );
open( my $CMD, '<', "$command |" )
Debug(2, 'Checking for shared memory with '.$command);
open( my $CMD, '<', $command.' |' )
or Fatal( "Can't execute '$command': $!" );
while( <$CMD> )
{
@ -167,8 +167,8 @@ sub zmMemClean
if ( $id =~ /^(\d+)/ )
{
$id = $1;
$command = "ipcrm shm $id";
Debug( "Removing shared memory with '$command'\n" );
$command = 'ipcrm shm '.$id;
Debug(2, 'Removing shared memory with '.$command);
qx( $command );
}
}