apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r743986 - /apr/apr-util/trunk/dbd/apr_dbd_freetds.c
Date Fri, 13 Feb 2009 05:03:10 GMT
Author: bojan
Date: Fri Feb 13 05:03:10 2009
New Revision: 743986

URL: http://svn.apache.org/viewvc?rev=743986&view=rev
Log:
Do not crash if process is NULL.
Do not print diagnostics to stderr (APU DBD operates silently).
Do not allow driver to exit the process (always return INT_CANCEL on error).

Modified:
    apr/apr-util/trunk/dbd/apr_dbd_freetds.c

Modified: apr/apr-util/trunk/dbd/apr_dbd_freetds.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbd/apr_dbd_freetds.c?rev=743986&r1=743985&r2=743986&view=diff
==============================================================================
--- apr/apr-util/trunk/dbd/apr_dbd_freetds.c (original)
+++ apr/apr-util/trunk/dbd/apr_dbd_freetds.c Fri Feb 13 05:03:10 2009
@@ -606,9 +606,7 @@
 
     process = dbopen(login, server);
 
-    fprintf(stderr, "databaseName [%s]\n", databaseName);
-
-    if (databaseName != NULL)
+    if (process != NULL && databaseName != NULL)
     {
         dbuse(process, databaseName);
     }
@@ -691,6 +689,11 @@
     regfree(&dbd_freetds_find_arg);
     return APR_SUCCESS;
 }
+static int freetds_err_handler(DBPROCESS *dbproc, int severity, int dberr,
+                               int oserr, char *dberrstr, char *oserrstr)
+{
+    return INT_CANCEL; /* never exit */
+}
 static void dbd_freetds_init(apr_pool_t *pool)
 {
     int rv = regcomp(&dbd_freetds_find_arg,
@@ -701,6 +704,7 @@
         fprintf(stderr, "regcomp failed: %s\n", errmsg);
     }
     dbinit();
+    dberrhandle(freetds_err_handler);
     apr_pool_cleanup_register(pool, NULL, freetds_term, apr_pool_cleanup_null);
 }
 



Mime
View raw message