httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@gmail.com>
Subject Re: svn commit: r1533810 - in /httpd/httpd/trunk: docs/man/rotatelogs.8 docs/manual/programs/rotatelogs.html.en support/rotatelogs.c
Date Sun, 20 Oct 2013 18:23:17 GMT
On Sun, Oct 20, 2013 at 1:54 PM, Ben Reser <ben@reser.org> wrote:

> On 10/20/13 5:31 AM, Ruediger Pluem wrote:
> >>      apr_pool_create(&newlog.pool, status->pool);
> >> +    if (config->create_path) {
> >> +        char *ptr = strrchr(newlog.name, '/');
> >> +        if (ptr && ptr > newlog.name) {
> >> +            char *path = apr_pstrmemdup(newlog.pool, newlog.name, ptr
> - newlog.name);
> >> +            if (config->verbose) {
> >> +                fprintf(stderr, "Creating directory tree %s\n", path);
> >> +            }
> >> +            rv = apr_dir_make_recursive(path, APR_FPROT_OS_DEFAULT,
> newlog.pool);
> >> +            if (rv != APR_SUCCESS) {
> >> +                char error[120];
> >> +
> >> +                apr_strerror(rv, error, sizeof error);
> >> +                fprintf(stderr, "Could not create directory '%s'
> (%s)\n", path, error);
> >
> > Can't we use apr_psprintf  with %pm instead of the constant length
> buffer char [120]?
>
> Only if we require APR 1.3.x or newer since %pm wasn't added till 1.3.0:
>
> https://apr.apache.org/docs/apr/1.4/group__apr__lib.html#gad2cd3594aeaafd45931d1034965f48c1
>
> The implementation I used here is similar to out error handling already in
> the
> file.
>

trunk and 2.4.x branch:

checking for APR... configure: WARNING: APR version 1.4.0 or later is
required, found 1.3.13
configure: WARNING: Found APR in
/home/trawick/inst/apr13-64/bin/apr-1-config, but we think it is considered
unacceptable
configure: error: the --with-apr parameter is incorrect. It must specify an
install prefix, a build directory, or an apr-config file.
configure failed

(I always forget about %pm :( )

-- 
Born in Roswell... married an alien...
http://emptyhammock.com/

Mime
View raw message