[Slim-Checkins] r9000 - /trunk/server/Slim/Player/Pipeline.pm
adrian at svn.slimdevices.com
adrian at svn.slimdevices.com
Thu Aug 17 05:51:36 PDT 2006
Author: adrian
Date: Thu Aug 17 05:51:34 2006
New Revision: 9000
URL: http://svn.slimdevices.com?rev=9000&view=rev
Log:
Bug: N/A
Description: No longer need to call waitpid in Pipeline.pm as
bootstrap.pm reaps child processes.
Modified:
trunk/server/Slim/Player/Pipeline.pm
Modified: trunk/server/Slim/Player/Pipeline.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Player/Pipeline.pm?rev=9000&r1=8999&r2=9000&view=diff
==============================================================================
--- trunk/server/Slim/Player/Pipeline.pm (original)
+++ trunk/server/Slim/Player/Pipeline.pm Thu Aug 17 05:51:34 2006
@@ -115,7 +115,7 @@
$reader = IO::Handle->new();
$writer = IO::Handle->new();
- ${*$self}{'pipeline_pid'} = open2($reader, $writer, $command);
+ open2($reader, $writer, $command);
unless (defined(Slim::Utils::Network::blocking($reader, 0))) {
$::d_source && msg "Cannot set pipe line reader to nonblocking\n";
@@ -316,27 +316,6 @@
if (defined($source)) {
$source->close();
}
-
- my $pid = ${*$self}{'pipeline_pid'};
- if (defined($pid)) {
- Slim::Utils::Timers::setTimer($pid, Time::HiRes::time() + 2, \&reapProcess);
- }
-}
-
-sub reapProcess {
- # avoid Zombie processes on non Windows systems by calling waitpid to reap them
- # required as SIGCHLD handler is no longer set to 'IGNORE'
- my $pid = shift;
- my $giveup = shift;
-
- if (waitpid($pid, WNOHANG) == 0) {
- if ($giveup) {
- errorMsg("pipeline child (pid:$pid) still running - unable to kill");
- } else {
- kill('TERM', $pid);
- Slim::Utils::Timers::setTimer($pid, Time::HiRes::time() + 2, \&reapProcess, 1);
- }
- }
}
1;
More information about the checkins
mailing list