perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@gmail.com>
Subject Re: PerlIO :APR / apr_file_open() flag issue
Date Sat, 25 Apr 2009 14:04:30 GMT
>The only issue I could see is if APR_WRITE was addeed
>at some point somewhat recently, and this change would break
>against older APRs.

APR_READ and/or APR_WRITE has been required since the first APR release.
Here's the logic to check for APR_READ/APR_WRITE back in 1999 (still called
"ap_open" at that point):

(
http://svn.apache.org/viewvc/apr/apr/branches/0.9.x/file_io/unix/open.c?revision=59512&view=markup
)

*if* ((flag & APR_READ) && (flag & APR_WRITE)) {

}
*else* *if* (flag & APR_READ) {

}
*else* *if* (flag & APR_WRITE) {

}
*else* {
    *return* APR_EACCES;
}



---------- Forwarded message ----------
From: "Philippe M. Chiasson" <gozer@apache.org>
To: Marc Adkins <madkins@marchex.com>
Date: Mon, 20 Apr 2009 23:51:57 -0400
Subject: Re: PerlIO :APR / apr_file_open() flag issue
On 20/04/09 19:59 , Marc Adkins wrote:
> Originally posted to the APR dev list.  The response (from jTrawick) was
> as follows:
>
>     The Perl code that builds the apr_file_open() flags needs to turn on
>     APR_WRITE.
>
>     I think that this patch to mod_perl is what you need:
>
>     --- modperl_apr_perlio.c.orig    2007-12-31 02:39:50.000000000 -0500
>     +++ modperl_apr_perlio.c    2009-04-20 19:37:25.954107404 -0400
>     @@ -85,7 +85,7 @@
>
>          switch (*mode) {
>            case 'a':
>     -        apr_flag = APR_APPEND | APR_CREATE;
>     +        apr_flag = APR_WRITE | APR_CREATE | APR_APPEND;
>              break;
>            case 'w':
>              apr_flag = APR_WRITE | APR_CREATE | APR_TRUNCATE;
>
>
> The rest of this email is my original post.  I would still like a
> workaround is one exists.

Looks sensible to me. The only issue I could see is if APR_WRITE was
addeed at some point somewhat recently, and this change would break
against older APRs. Might need a version check of some sort.

Otherwise, +1

Mime
View raw message