Merge pull request #1295 from ZoneMinder/zmdc_better_error_messages

include the sock path in the error message and output an error on fai…
This commit is contained in:
Andrew Bauer 2016-02-16 10:04:11 -06:00
commit 5f771327be
1 changed files with 4 additions and 2 deletions

View File

@ -250,13 +250,15 @@ sub run
{
print( $PID $$ );
close( $PID );
} else {
Error( "Can't open pid file at " . ZM_PID );
}
killAll( 1 );
socket( SERVER, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" );
unlink( main::SOCK_FILE );
bind( SERVER, $saddr ) or Fatal( "Can't bind: $!" );
unlink( main::SOCK_FILE ) or Error( "Unable to unlink " . main::SOCK_FILE );
bind( SERVER, $saddr ) or Fatal( "Can't bind to " . main::SOCK_FILE . ": $!" );
listen( SERVER, SOMAXCONN ) or Fatal( "Can't listen: $!" );
$SIG{CHLD} = \&reaper;