You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ruediger Pluem <rp...@apache.org> on 2008/08/26 23:31:25 UTC

Re: svn commit: r689224 - /httpd/httpd/trunk/modules/database/mod_dbd.c


On 08/26/2008 11:03 PM, niq@apache.org wrote:
> Author: niq
> Date: Tue Aug 26 14:03:46 2008
> New Revision: 689224
> 
> URL: http://svn.apache.org/viewvc?rev=689224&view=rev
> Log:
> Try to get a meaningful error message when dbd_open fails
> 
> Modified:
>     httpd/httpd/trunk/modules/database/mod_dbd.c
> 
> Modified: httpd/httpd/trunk/modules/database/mod_dbd.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/database/mod_dbd.c?rev=689224&r1=689223&r2=689224&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/database/mod_dbd.c (original)
> +++ httpd/httpd/trunk/modules/database/mod_dbd.c Tue Aug 26 14:03:46 2008
> @@ -464,6 +464,7 @@
>      apr_pool_t *rec_pool, *prepared_pool;
>      ap_dbd_t *rec;
>      apr_status_t rv;
> +    const char *err = "";
>  
>      rv = apr_pool_create(&rec_pool, pool);
>      if (rv != APR_SUCCESS) {
> @@ -507,12 +508,12 @@
>          return rv;
>      }
>  
> -    rv = apr_dbd_open(rec->driver, rec->pool, cfg->params, &rec->handle);
> +    rv = apr_dbd_open_ex(rec->driver, rec->pool, cfg->params, &rec->handle, &err);
>      if (rv != APR_SUCCESS) {
>          switch (rv) {
>          case APR_EGENERAL:
>              ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server,
> -                         "DBD: Can't connect to %s", cfg->name);
> +                         "DBD: Can't connect to %s: %s", cfg->name, &err);

Shouldn't this be

err

instead of

&err

here?

Regards

RĂ¼diger


Re: svn commit: r689224 - /httpd/httpd/trunk/modules/database/mod_dbd.c

Posted by Nick Kew <ni...@webthing.com>.
On Tue, 26 Aug 2008 23:31:25 +0200
Ruediger Pluem <rp...@apache.org> wrote:

> [chop]

Bah.  Thanks for spotting that.

Just trying to clean up my repo here - going through differences
between /trunk/ and mine and either committing or abandoning
local variants.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/