Skip Menu |

This queue is for tickets about the Proc-Daemon CPAN distribution.

Report information
The Basics
Id: 67123
Status: resolved
Priority: 0/
Queue: Proc-Daemon

People
Owner: Nobody in particular
Requestors: drhuettl+cpan [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.09
Fixed in: (no value)



Subject: improve how Init() determines whether it was passed a blessed object
The Init() method uses ref() to determine whether the provided $self variable is a Proc::Daemon object or not. That logic doesn't work when the Proc::Daemon has been sub-classed. The attached patch uses UNIVERSAL::isa() to determine inheritance, instead.
Subject: proc-daemon.patch
--- Daemon.pm.bak 2011-03-29 11:26:37.000011000 -0500 +++ Daemon.pm 2011-03-31 12:30:19.000020000 -0500 @@ -78,7 +78,8 @@ # Check if $self has been blessed into the package, otherwise do it now. - if ( ref( $self ) ne 'Proc::Daemon' ) { + my $ready = eval { $self->isa('Proc::Daemon') }; + if ( $@ || ! $ready ) { $self = ref( $self ) eq 'HASH' ? Proc::Daemon->new( %$self ) : Proc::Daemon->new(); } # If $daemon->Init is used again in the same script,
Thanks. Improvement added.

Package updated now (will be visible on CPAN in the next hours).