[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[patch] [Issue 566] Import fails on Win32 due to APR bug/problem

From: Barry Pederson <barryp_at_yahoo.com>
Date: 2001-11-28 23:15:48 CET

Karl Fogel wrote:

> Barry, can you post the patch to the list along with a log message?
>
> (This avoids possible Issuezilla mangling, too.)

This patch fixes a problem that keeps svn "import" from working Win32.

When apr_read_dir() is called with APR_FINFO_NORM as its "wanted" flag,
APR on a Win32 box returns APR_INCOMPLETE, instead of APR_SUCCESS because
the APR_FINFO_NORM bitmask includes bits indicating you want dev and inode
info, and those aren't available on the Win32 platform.

With this patch, Subversion's libsvn_client/add.c and
libsvn_client/commit.c only
ask for name and type info, which is all they really need, it should
work for all
platforms, and is consistent with how apr_read_dir() is called in
libsvn_subr/io.c

     Barry

Index: .\subversion\libsvn_client\add.c
===================================================================
--- .\subversion\libsvn_client\.svn\text-base\add.c.svn-base Tue Nov 27 15:35:50 2001
+++ .\subversion\libsvn_client\add.c Tue Nov 27 15:42:17 2001
@@ -43,6 +43,7 @@
   apr_finfo_t this_entry;
   apr_status_t apr_err;
   apr_pool_t *subpool;
+ apr_int32_t flags = APR_FINFO_TYPE | APR_FINFO_NAME;
 
   /* Add this directory to revision control. */
   SVN_ERR (svn_wc_add_directory (svn_stringbuf_create (dirname, pool),
@@ -55,9 +56,9 @@
   /* Read the directory entries one by one and add those things to
      revision control. */
   apr_err = apr_dir_open (&dir, dirname, pool);
- for (apr_err = apr_dir_read (&this_entry, APR_FINFO_NORM, dir);
+ for (apr_err = apr_dir_read (&this_entry, flags, dir);
        APR_STATUS_IS_SUCCESS (apr_err);
- apr_err = apr_dir_read (&this_entry, APR_FINFO_NORM, dir))
+ apr_err = apr_dir_read (&this_entry, flags, dir))
     {
       svn_stringbuf_t *fullpath;
 
Index: .\subversion\libsvn_client\commit.c
===================================================================
--- .\subversion\libsvn_client\.svn\text-base\commit.c.svn-base Sun Nov 25 21:21:25 2001
+++ .\subversion\libsvn_client\commit.c Tue Nov 27 15:42:37 2001
@@ -155,11 +155,12 @@
   apr_dir_t *dir;
   apr_finfo_t this_entry;
   apr_status_t apr_err;
+ apr_int32_t flags = APR_FINFO_TYPE | APR_FINFO_NAME;
 
   apr_err = apr_dir_open (&dir, path->data, subpool);
- for (apr_err = apr_dir_read (&this_entry, APR_FINFO_NORM, dir);
+ for (apr_err = apr_dir_read (&this_entry, flags, dir);
        APR_STATUS_IS_SUCCESS (apr_err);
- apr_err = apr_dir_read (&this_entry, APR_FINFO_NORM, dir))
+ apr_err = apr_dir_read (&this_entry, flags, dir))
     {
       svn_stringbuf_t *new_path = svn_stringbuf_dup (path, subpool);
       svn_path_add_component (new_path,

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:49 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.