You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Guenter Knauf <fu...@apache.org> on 2007/06/29 20:32:14 UTC

Re: svn commit: r551983 - in /apr/apr-util/branches/1.2.x: dbd/apr_dbd.c

> --- apr/apr-util/branches/1.2.x/dbd/apr_dbd.c (original)
> +++ apr/apr-util/branches/1.2.x/dbd/apr_dbd.c Fri Jun 29 11:08:58 2007
> @@ -126,6 +126,8 @@

>  #ifdef WIN32
>      sprintf(path, "apr_dbd_%s.dll", name);
> +#elif defined(NETWARE)
> +    sprintf(path, "dbd%s.nlm", name);
>  #else
>      sprintf(path, "apr_dbd_%s.so", name);
>  #endif
this part looks in apr-util 1.3.x trunk:

#ifdef WIN32
    sprintf(path, "apr_dbd_%s.dll", name);
#elif defined(NETWARE)
    apr_snprintf(path, sizeof path, "dbd%s.nlm", name);
#else
    apr_snprintf(path, sizeof path, APU_DSO_LIBDIR "/apr_dbd_%s.so", name);
#endif

I think that we should use in 1.3.x also apr_snprintf() for the WIN32 load;
and that we use same in 1.2.x

Guenter.



Re: svn commit: r551983 - in /apr/apr-util/branches/1.2.x: dbd/apr_dbd.c

Posted by Guenter Knauf <fu...@apache.org>.
Hi,
if nobody objects I will soon commit the following patch to both 1.3.x / 1.2.x trunk;
this moves the dbd driver name to platform-own apu.h header files, and removes the ifdefs in apr_dbd.c:
############################################################################# 
--- dbd\apr_dbd.c.orig	Wed Jun 27 14:53:02 2007
+++ dbd\apr_dbd.c	Tue Jul 03 16:14:40 2007
@@ -150,19 +150,12 @@
     /* The driver DSO must have exactly the same lifetime as the
      * drivers hash table; ignore the passed-in pool */
     pool = apr_hash_pool_get(drivers);
-
-#ifdef WIN32
-    sprintf(path, "apr_dbd_%s.dll", name);
-#elif defined(NETWARE)
-    apr_snprintf(path, sizeof path, "dbd%s.nlm", name);
-#else
-    apr_snprintf(path, sizeof path, APU_DSO_LIBDIR "/apr_dbd_%s.so", name);
-#endif
+    apr_snprintf(path, sizeof path, APU_DBD_DRIVER_FMT, name);
     rv = apr_dso_load(&dlhandle, path, pool);
     if (rv != APR_SUCCESS) { /* APR_EDSOOPEN */
         goto unlock;
     }
-    sprintf(path, "apr_dbd_%s_driver", name);
+    apr_snprintf(path, sizeof path, "apr_dbd_%s_driver", name);
     rv = apr_dso_sym(&symbol, dlhandle, path);
     if (rv != APR_SUCCESS) { /* APR_ESYMNOTFOUND */
         apr_dso_unload(dlhandle);
############################################################################# 
--- include\apu.h.in.orig	Wed Jun 27 14:53:00 2007
+++ include\apu.h.in	Tue Jul 03 16:13:06 2007
@@ -88,5 +88,7 @@
 #define APU_HAVE_ICONV         @have_iconv@
 #define APR_HAS_XLATE          (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)
 
+#define APU_DBD_DRIVER_FMT APU_DSO_LIBDIR "/apr_dbd_%s.so"
+
 #endif /* APU_H */
 /** @} */
############################################################################# 
--- include\apu.hnw.orig	Wed Jun 27 14:53:00 2007
+++ include\apu.hnw	Tue Jul 03 16:12:34 2007
@@ -82,5 +82,7 @@
 #define APU_HAVE_ICONV         1
 #define APR_HAS_XLATE          (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)
 
+#define APU_DBD_DRIVER_FMT "dbd%s.nlm"
+
 #endif /* APU_H */
 /** @} */
############################################################################# 
--- include\apu.hw.orig	Wed Jun 27 14:53:00 2007
+++ include\apu.hw	Tue Jul 03 16:11:18 2007
@@ -109,5 +109,7 @@
 #define APU_HAVE_SQLITE3    0
 #endif
 
+#define APU_DBD_DRIVER_FMT "apr_dbd_%s.dll"
+
 #endif /* APU_H */
 #endif /* WIN32 */
############################################################################# 

Guenter.