Perhaps Net::FTP changed underneath you? But you would expect it to use
syswrite from the outset. It is strange, but you definately can't
syswrite to a memory file in perl 5.8. Maybe its the newer versions of
perl?
Who knows
On Thu, 2005-05-12 at 07:33, Horms wrote:
> On Wed, May 11, 2005 at 11:09:23AM -0400, Purcocks, Graham wrote:
> > Horm
> >
> > Here is a patch, I changed from a memory file to a virtual temporary
> > file. This is after appying both the mysql patch and the Postgres patch.
> >
> > -----------------------------------------------------
> > --- /usr/sbin/ldirectord 2005-04-28 17:13:40.000000000 +0000
> > +++ ldirectord 2005-05-11 14:51:57.000000000 +0000
> > @@ -2079,7 +2079,8 @@
> >
> > &ld_debug(2, "Checking ftp server=$$r{server} port=$port");
> >
> > - open(MEMORY,'>', \$memory);
> > + # Open temporary file
> > + open(TMP,'>', undef);
> >
> > unless ($ftp = Net::FTP->new("$$r{server}:$port",
> > Timeout=>$$v{negotiatetimeout})) {
> > @@ -2090,10 +2091,14 @@
> > $ftp->cwd("/");
> > $ftp->binary();
> > $ftp->pasv();
> > - $ftp->get("$$r{request}", *MEMORY);
> > + $ftp->get("$$r{request}", *TMP);
> > $ftp->quit();
> >
> > - close(MEMORY);
> > + seek TMP, 0, 0;
> > + select TMP;
> > + undef $/;
> > + $memory = <TMP>;
> > + close TMP;
> >
> > if ($memory =~ /$$r{receive}/) {
> > service_set($v, $r, "up");
> > ---------------------------------------------------------
> >
> > Is this OK?
>
> That seems fine, I will go ahead and put it into CVS.
> Bit weird that the memory FD broke at some stage.
--
|