[interchange-cvs] interchange - heins modified lib/Vend/Server.pm
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Fri Jul 11 14:25:00 EDT 2003
User: heins
Date: 2003-07-11 17:25:34 GMT
Modified: lib/Vend Server.pm
Log:
* Fix nasty context problem in calling getppid from subroutine reference.
Revision Changes Path
2.36 +10 -8 interchange/lib/Vend/Server.pm
rev 2.36, prev_rev 2.35
Index: Server.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Server.pm,v
retrieving revision 2.35
retrieving revision 2.36
diff -u -r2.35 -r2.36
--- Server.pm 11 Jul 2003 04:39:43 -0000 2.35
+++ Server.pm 11 Jul 2003 17:25:34 -0000 2.36
@@ -1,6 +1,6 @@
# Vend::Server - Listen for Interchange CGI requests as a background server
#
-# $Id: Server.pm,v 2.35 2003/07/11 04:39:43 mheins Exp $
+# $Id: Server.pm,v 2.36 2003/07/11 17:25:34 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -26,7 +26,7 @@
package Vend::Server;
use vars qw($VERSION);
-$VERSION = substr(q$Revision: 2.35 $, 10);
+$VERSION = substr(q$Revision: 2.36 $, 10);
use POSIX qw(setsid strftime);
use Vend::Util;
@@ -37,7 +37,7 @@
use Symbol;
use strict;
-my $ppidsub = \&getppid;
+my $ppidsub = sub { return getppid };
sub new {
my ($class, $fh, $env, $entity) = @_;
@@ -1611,7 +1611,7 @@
}
undef $::Instance;
- select(undef,undef,undef,0.050) until $ppidsub->() == 1;
+ select(undef,undef,undef,0.050) until &$ppidsub == 1;
&$Sig_dec and unlink_pid();
exit(0);
}
@@ -2168,7 +2168,7 @@
clean_up_after_fork();
undef $::Instance;
- select(undef,undef,undef,0.050) until $ppidsub->() == 1;
+ select(undef,undef,undef,0.050) until &$ppidsub == 1;
if ($Global::IPCsocket) {
&$Sig_dec and unlink_pid();
}
@@ -2307,7 +2307,7 @@
clean_up_after_fork();
undef $::Instance;
- select(undef,undef,undef,0.050) until $ppidsub->() == 1;
+ select(undef,undef,undef,0.050) until &$ppidsub == 1;
if ($Global::PIDcheck) {
unlink_pid() and &$Sig_dec;
}
@@ -2339,7 +2339,7 @@
no strict 'subs';
truncate($fh, 0) or die "Couldn't truncate pid file: $!\n";
}
- print $fh ($Global::mod_perl ? $ppidsub->() : $$), "\n";
+ print $fh ($Global::mod_perl ? &$ppidsub : $$), "\n";
return 0;
}
@@ -2481,7 +2481,9 @@
}
else {
# child 2
- sleep 1 until $ppidsub->() == 1;
+#::logDebug("getting ready to sleep ...");
+ sleep 1 until &$ppidsub == 1;
+#::logDebug("slept ...");
my $running = grab_pid($pidh);
if ($running) {
More information about the interchange-cvs
mailing list