Log the reason for croaking before croaking.
This commit is contained in:
parent
46efe9c1e0
commit
3a512f87a5
|
@ -63,9 +63,18 @@ sub open
|
|||
local *sfh;
|
||||
unlink( $self->{path} );
|
||||
my $saddr = sockaddr_un( $self->{path} );
|
||||
socket( *sfh, PF_UNIX, SOCK_STREAM, 0 ) or croak( "Can't open socket: $!" );
|
||||
bind( *sfh, $saddr ) or croak( "Can't bind: $!" );
|
||||
listen( *sfh, SOMAXCONN ) or croak( "Can't listen: $!" );
|
||||
if ( ! socket( *sfh, PF_UNIX, SOCK_STREAM, 0 ) ) {
|
||||
Error( "Can't open unix socket at $$self{path}: $!" );
|
||||
croak( "Can't open unix socket at $$self{path}: $!" );
|
||||
}
|
||||
if ( ! bind( *sfh, $saddr ) ) {
|
||||
Error( "Can't bind unix socket at $$self{path}: $!" );
|
||||
croak( "Can't bind unix socket at $$self{path}: $!" );
|
||||
}
|
||||
if ( ! listen( *sfh, SOMAXCONN ) ) {
|
||||
Error( "Can't listen: $!" );
|
||||
croak( "Can't listen: $!" );
|
||||
}
|
||||
$self->{handle} = *sfh;
|
||||
}
|
||||
|
||||
|
@ -93,12 +102,11 @@ __END__
|
|||
|
||||
=head1 NAME
|
||||
|
||||
ZoneMinder::Database - Perl extension for blah blah blah
|
||||
ZoneMinder::Trigger::Channel::Unix - Object for Unix socket channel
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use ZoneMinder::Database;
|
||||
blah blah blah
|
||||
See zmtrigger.pl
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
|
|
Loading…
Reference in New Issue