Re: [mp2] Possible bug in Apache::Reload

[prev] [thread] [next] [Date index for 2005/03/28]

From: Chris Warren
Subject: Re: [mp2] Possible bug in Apache::Reload
Date: 20:12 on 28 Mar 2005
On Fri, 25 Mar 2005 17:59:25 -0500, Stas Bekman wrote:

>Absolutely right, Chris: both should be return Apache::OK. Care to post a 
>patch here after you've tested it? (since we don't have a test for it, at 
>least not yet)

Sorry this took so long -- I didn't have Subversion installed, and
wanted to do everything the Right Way. (If I've left something out,
please let me know.)

This change prevents a 500 error from occurring when the touchfile
hasn't been updated and when the touchfile doesn't exist.

$ diff -u mod_perl-2.0/lib/Apache/Reload.pm~
mod_perl-2.0/lib/Apache/Reload.pm
--- mod_perl-2.0/lib/Apache/Reload.pm~  Mon Mar 28 15:04:54 2005
+++ mod_perl-2.0/lib/Apache/Reload.pm   Mon Mar 28 15:05:17 2005
@@ -95,8 +95,8 @@

     if ($TouchFile) {
         warn "Checking mtime of $TouchFile\n" if $DEBUG;
-        my $touch_mtime = (stat $TouchFile)[9] || return 1;
-        return 1 unless $touch_mtime > $TouchTime;
+        my $touch_mtime = (stat $TouchFile)[9] || return Apache::OK;
+        return Apache::OK unless $touch_mtime > $TouchTime;
         $TouchTime = $touch_mtime;
         open my $fh, $TouchFile or die "Can't open '$TouchFile': $!";
         $TouchModules = <$fh>;
        -- 
         /¯\
 \ /   ASCII RIBBON CAMPAIGN
  X  Against HTML Mail and News
 / \

[mp2] Possible bug in Apache::Reload
Chris Warren 16:17 on 25 Mar 2005

Re: [mp2] Possible bug in Apache::Reload
Stas Bekman 22:59 on 25 Mar 2005

Re: [mp2] Possible bug in Apache::Reload
Chris Warren 20:12 on 28 Mar 2005

Re: [mp2] Possible bug in Apache::Reload
Stas Bekman 21:26 on 28 Mar 2005

Generated at 14:43 on 11 Apr 2005 by mariachi v0.52