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

Re: CVS update: subversion/subversion/libsvn_subr xml.c

From: Branko Èibej <brane_at_xbc.nu>
Date: 2000-11-07 01:41:40 CET

Karl Fogel wrote:

> Branko =?ISO-8859-2?Q?=C8ibej?= <brane@xbc.nu> writes:
>
>> Do you know, with that fix (and a rather huge patch which I'll be asking
>> for review for, shortly), I actually get the client to checkout on
>> Win32. Now it only chokes on commit.
>
Silly me, it chokes on update, not commit.

>> Oh, and the libsvn_fs tests all pass, yay!
>
>
> You rock.
>
> Ready to review the patch anytime...

Attached.

It's actually two changes in SVN, but they're intermixed a bit, so I
didn't try to pry them apart:

    * Change all tests of APR status codes (except for tests for
      APR_SUCCESS) to use APR_STATUS_IS_blabla() macros. This is
      necessary for Win32, because there are actually several different
      possible codes for some kinds of errors. The APR macros take care
      of that, and should be portable. This should also be the Right Way
      to write such tests in future.
      
    * In check_adm_exist and svn_wc__ensure_directory, replace the
      apr_opendir checks with apr_stat. That's because apr_opendir won't
      return ENOENT on Win32, and I guess apr_stat should be faster in
      general, anyway. There might be a problem here with symlinks to
      directories, but from what I've seen, we don't support symlinks
      right now. Another possibility would be to change apr_opendir to
      return ENOENT everywhere.
      
    * Two fixes in APR file_io code (already mentioned in another post),
      which Greg Stein needs to review and approve.
      

I haven't tested this patch on a Unix box yet, although I believe it
should be fine. I'll certainly do that before checking in.

Then there are some changes in the MSVC project files, but those will go
in when they're ready, and they're not important right now.

-- 
Brane �ibej
    home:   <brane_at_xbc.nu>             http://www.xbc.nu/brane/
    work:   <branko.cibej_at_hermes.si>   http://www.hermes-softlab.com/
     ACM:   <brane_at_acm.org>            http://www.acm.org/


Index: file_io/win32/readwrite.c
===================================================================
RCS file: /home/cvspublic/apache-2.0/src/lib/apr/file_io/win32/readwrite.c,v
retrieving revision 1.47
diff -u -p -r1.47 readwrite.c
--- file_io/win32/readwrite.c 2000/10/16 06:04:40 1.47
+++ file_io/win32/readwrite.c 2000/11/07 00:09:23
@@ -139,7 +139,10 @@ static apr_status_t read_with_timeout(ap
             rv = APR_SUCCESS; /* APR_EOF? */
         }
     } else {
- rv = APR_SUCCESS;
+ if (*nbytes == 0) /* OK and 0 bytes read ==> end of file */
+ rv = APR_EOF;
+ else
+ rv = APR_SUCCESS;
     }
     return rv;
 }
@@ -240,6 +243,7 @@ apr_status_t apr_write(apr_file_t *thefi
             thefile->direction = 1;
         }
 
+ rv = 0;
         while (rv == 0 && size > 0) {
             if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full
                 rv = apr_flush(thefile);

Received on Sat Oct 21 14:36:14 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.