You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@apache.org on 2001/12/05 20:09:37 UTC

cvs commit: modperl-2.0/lib/Apache compat.pm

dougm       01/12/05 11:09:37

  Modified:    lib/Apache compat.pm
  Log:
  more info in Apache::File->tmpfile if Apache->request isn't available
  
  Revision  Changes    Path
  1.27      +3 -2      modperl-2.0/lib/Apache/compat.pm
  
  Index: compat.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- compat.pm	2001/12/05 16:03:25	1.26
  +++ compat.pm	2001/12/05 19:09:37	1.27
  @@ -302,13 +302,14 @@
       my $limit = 100;
       my $r = Apache->request;
       unless ($r) {
  -        die "'PerlOptions +GlobalRequest' setting is required";
  +        die "cannot use Apache::File->tmpfile ".
  +          "without 'SetHandler perl-script' or 'PerlOptions +GlobalRequest'";
       }
       while ($limit--) {
           my $tmpfile = "$TMPDIR/${$}" . $TMPNAM++;
           my $fh = $class->new;
           sysopen($fh, $tmpfile, $Mode, $Perms);
  -        $r->pool->cleanup_register(sub { unlink $tmpfile }) if $r;
  +        $r->pool->cleanup_register(sub { unlink $tmpfile });
           if ($fh) {
   	    return wantarray ? ($tmpfile, $fh) : $fh;
   	}