You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2012/12/31 17:49:40 UTC

svn commit: r1427176 - in /subversion/trunk/subversion: include/svn_io.h libsvn_client/patch.c libsvn_diff/parse-diff.c libsvn_fs_base/fs.c libsvn_subr/io.c libsvn_subr/stream.c svn/file-merge.c

Author: rhuijben
Date: Mon Dec 31 16:49:40 2012
New Revision: 1427176

URL: http://svn.apache.org/viewvc?rev=1427176&view=rev
Log:
Document that svn_io_file_open() always uses APR_BINARY, and update callers
to stop providing this implied flag.

* subversion/include/svn_io.h
  (svn_io_file_open): Update comment.

* subversion/libsvn_client/patch.c
  (init_patch_target):

* subversion/libsvn_diff/parse-diff.c
  (svn_diff_open_patch_file):

* subversion/libsvn_fs_base/fs.c
  (copy_db_file_safely):

* subversion/libsvn_subr/io.c
  (svn_io_copy_file,
   io_set_file_perms):

* subversion/libsvn_subr/stream.c
  (svn_stream_open_readonly,
   svn_stream_open_writable):

* subversion/svn/file-merge.c
  (svn_cl__merge_file):
     Update callers.

Modified:
    subversion/trunk/subversion/include/svn_io.h
    subversion/trunk/subversion/libsvn_client/patch.c
    subversion/trunk/subversion/libsvn_diff/parse-diff.c
    subversion/trunk/subversion/libsvn_fs_base/fs.c
    subversion/trunk/subversion/libsvn_subr/io.c
    subversion/trunk/subversion/libsvn_subr/stream.c
    subversion/trunk/subversion/svn/file-merge.c

Modified: subversion/trunk/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_io.h?rev=1427176&r1=1427175&r2=1427176&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_io.h (original)
+++ subversion/trunk/subversion/include/svn_io.h Mon Dec 31 16:49:40 2012
@@ -1935,7 +1935,8 @@ svn_boolean_t
 svn_io_is_binary_data(const void *buf, apr_size_t len);
 
 
-/** Wrapper for apr_file_open().  @a fname is utf8-encoded. */
+/** Wrapper for apr_file_open().  @a fname is utf8-encoded.
+    Always passed flag | APR_BINARY to apr. */
 svn_error_t *
 svn_io_file_open(apr_file_t **new_file,
                  const char *fname,

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1427176&r1=1427175&r2=1427176&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Mon Dec 31 16:49:40 2012
@@ -915,7 +915,7 @@ init_patch_target(patch_target_t **patch
       if (target->kind_on_disk == svn_node_file)
         {
           SVN_ERR(svn_io_file_open(&target->file, target->local_abspath,
-                                   APR_READ | APR_BINARY | APR_BUFFERED,
+                                   APR_READ | APR_BUFFERED,
                                    APR_OS_DEFAULT, result_pool));
           SVN_ERR(svn_wc_text_modified_p2(&target->local_mods, wc_ctx,
                                           target->local_abspath, FALSE,

Modified: subversion/trunk/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/parse-diff.c?rev=1427176&r1=1427175&r2=1427176&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/trunk/subversion/libsvn_diff/parse-diff.c Mon Dec 31 16:49:40 2012
@@ -1147,8 +1147,8 @@ svn_diff_open_patch_file(svn_patch_file_
   svn_patch_file_t *p;
 
   p = apr_palloc(result_pool, sizeof(*p));
-  SVN_ERR(svn_io_file_open(&p->apr_file, local_abspath,
-                           APR_READ | APR_BINARY, 0, result_pool));
+  SVN_ERR(svn_io_file_open(&p->apr_file, local_abspath, APR_READ,
+                           APR_OS_DEFAULT, result_pool));
   p->next_patch_offset = 0;
   *patch_file = p;
 

Modified: subversion/trunk/subversion/libsvn_fs_base/fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/fs.c?rev=1427176&r1=1427175&r2=1427176&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_base/fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_base/fs.c Mon Dec 31 16:49:40 2012
@@ -1124,7 +1124,7 @@ copy_db_file_safely(const char *src_dir,
   /* Open source file.  If it's missing and that's allowed, there's
      nothing more to do here. */
   err = svn_io_file_open(&s, file_src_path,
-                         (APR_READ | APR_LARGEFILE | APR_BINARY),
+                         (APR_READ | APR_LARGEFILE),
                          APR_OS_DEFAULT, pool);
   if (err && APR_STATUS_IS_ENOENT(err->apr_err) && allow_missing)
     {
@@ -1135,7 +1135,7 @@ copy_db_file_safely(const char *src_dir,
 
   /* Open destination file. */
   SVN_ERR(svn_io_file_open(&d, file_dst_path, (APR_WRITE | APR_CREATE |
-                                               APR_LARGEFILE | APR_BINARY),
+                                               APR_LARGEFILE),
                            APR_OS_DEFAULT, pool));
 
   /* Allocate our read/write buffer. */

Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=1427176&r1=1427175&r2=1427176&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Mon Dec 31 16:49:40 2012
@@ -834,7 +834,7 @@ svn_io_copy_file(const char *src,
     return SVN_NO_ERROR;
 #endif
 
-  SVN_ERR(svn_io_file_open(&from_file, src, APR_READ | APR_BINARY,
+  SVN_ERR(svn_io_file_open(&from_file, src, APR_READ,
                            APR_OS_DEFAULT, pool));
 
   /* For atomicity, we copy to a tmp file and then rename the tmp
@@ -1536,7 +1536,7 @@ io_set_file_perms(const char *path,
 
           /* Get the perms for the original file so we'll have any other bits
            * that were already set (like the execute bits, for example). */
-          SVN_ERR(svn_io_file_open(&fd, path, APR_READ | APR_BINARY,
+          SVN_ERR(svn_io_file_open(&fd, path, APR_READ,
                                    APR_OS_DEFAULT, pool));
           SVN_ERR(merge_default_file_perms(fd, &perms_to_set, pool));
           SVN_ERR(svn_io_file_close(fd, pool));

Modified: subversion/trunk/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/stream.c?rev=1427176&r1=1427175&r2=1427176&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/stream.c (original)
+++ subversion/trunk/subversion/libsvn_subr/stream.c Mon Dec 31 16:49:40 2012
@@ -847,7 +847,7 @@ svn_stream_open_readonly(svn_stream_t **
 {
   apr_file_t *file;
 
-  SVN_ERR(svn_io_file_open(&file, path, APR_READ | APR_BUFFERED | APR_BINARY,
+  SVN_ERR(svn_io_file_open(&file, path, APR_READ | APR_BUFFERED,
                            APR_OS_DEFAULT, result_pool));
   *stream = svn_stream_from_aprfile2(file, FALSE, result_pool);
 
@@ -866,7 +866,6 @@ svn_stream_open_writable(svn_stream_t **
   SVN_ERR(svn_io_file_open(&file, path,
                            APR_WRITE
                              | APR_BUFFERED
-                             | APR_BINARY
                              | APR_CREATE
                              | APR_EXCL,
                            APR_OS_DEFAULT, result_pool));

Modified: subversion/trunk/subversion/svn/file-merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/file-merge.c?rev=1427176&r1=1427175&r2=1427176&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/file-merge.c (original)
+++ subversion/trunk/subversion/svn/file-merge.c Mon Dec 31 16:49:40 2012
@@ -862,13 +862,13 @@ svn_cl__merge_file(const char *base_path
                                    scratch_pool)));
 
   SVN_ERR(svn_io_file_open(&original_file, base_path,
-                           APR_READ|APR_BUFFERED|APR_BINARY,
+                           APR_READ | APR_BUFFERED,
                            APR_OS_DEFAULT, scratch_pool));
   SVN_ERR(svn_io_file_open(&modified_file, their_path,
-                           APR_READ|APR_BUFFERED|APR_BINARY,
+                           APR_READ | APR_BUFFERED,
                            APR_OS_DEFAULT, scratch_pool));
   SVN_ERR(svn_io_file_open(&latest_file, my_path,
-                           APR_READ|APR_BUFFERED|APR_BINARY,
+                           APR_READ | APR_BUFFERED,
                            APR_OS_DEFAULT, scratch_pool));
   SVN_ERR(svn_io_open_unique_file3(&merged_file, &merged_file_name,
                                    NULL, svn_io_file_del_none,