You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/05/13 15:46:11 UTC

svn commit: r1481848 - in /subversion/trunk: configure.ac subversion/libsvn_subr/cache-inprocess.c

Author: brane
Date: Mon May 13 13:46:11 2013
New Revision: 1481848

URL: http://svn.apache.org/r1481848
Log:
* configure.ac: Fix a typo in the typo fix.

Modified:
    subversion/trunk/configure.ac
    subversion/trunk/subversion/libsvn_subr/cache-inprocess.c

Modified: subversion/trunk/configure.ac
URL: http://svn.apache.org/viewvc/subversion/trunk/configure.ac?rev=1481848&r1=1481847&r2=1481848&view=diff
==============================================================================
--- subversion/trunk/configure.ac (original)
+++ subversion/trunk/configure.ac Mon May 13 13:46:11 2013
@@ -1123,7 +1123,7 @@ AC_MSG_NOTICE([    user-defined: $CUSERF
 AC_MSG_NOTICE([ maintainer-mode: $CMAINTAINERFLAGS])
 AC_MSG_NOTICE([C++ compiler flags: $CXXFLAGS])
 AC_MSG_NOTICE([      user-defined: $CXXUSERFLAGS])
-AC_MSG_NOTICE([   maintanier-mode: $CXXMAINTAINERFLAGS])
+AC_MSG_NOTICE([   maintainer-mode: $CXXMAINTAINERFLAGS])
 
 AC_ARG_ENABLE(full-version-match,
 AS_HELP_STRING([--disable-full-version-match],

Modified: subversion/trunk/subversion/libsvn_subr/cache-inprocess.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/cache-inprocess.c?rev=1481848&r1=1481847&r2=1481848&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/cache-inprocess.c (original)
+++ subversion/trunk/subversion/libsvn_subr/cache-inprocess.c Mon May 13 13:46:11 2013
@@ -190,7 +190,6 @@ inprocess_cache_get_internal(char **buff
 {
   struct cache_entry *entry = apr_hash_get(cache->hash, key, cache->klen);
 
-  *buffer = NULL;
   if (entry)
     {
       SVN_ERR(move_page_to_front(cache, entry->page));
@@ -201,6 +200,11 @@ inprocess_cache_get_internal(char **buff
 
       *size = entry->size;
     }
+  else
+    {
+      *buffer = NULL;
+      *size = 0;
+    }
 
   return SVN_NO_ERROR;
 }
@@ -213,25 +217,33 @@ inprocess_cache_get(void **value_p,
                     apr_pool_t *result_pool)
 {
   inprocess_cache_t *cache = cache_void;
-  char* buffer = NULL;
-  apr_size_t size = 0;
 
   if (key)
-    SVN_MUTEX__WITH_LOCK(cache->mutex,
-                         inprocess_cache_get_internal(&buffer,
-                                                      &size,
-                                                      cache,
-                                                      key,
-                                                      result_pool));
+    {
+      char* buffer;
+      apr_size_t size;
 
-  /* deserialize the buffer content. Usually, this will directly
-     modify the buffer content directly.
-   */
-  *value_p = NULL;
-  *found = buffer != NULL;
-  return buffer && size
-    ? cache->deserialize_func(value_p, buffer, size, result_pool)
-    : SVN_NO_ERROR;
+      SVN_MUTEX__WITH_LOCK(cache->mutex,
+                           inprocess_cache_get_internal(&buffer,
+                                                        &size,
+                                                        cache,
+                                                        key,
+                                                        result_pool));
+      /* deserialize the buffer content. Usually, this will directly
+         modify the buffer content directly. */
+      *found = (buffer != NULL);
+      if (!buffer || !size)
+        *value_p = NULL;
+      else
+        return cache->deserialize_func(value_p, buffer, size, result_pool);
+    }
+  else
+    {
+      *value_p = NULL;
+      *found = FALSE;
+    }
+
+  return SVN_NO_ERROR;
 }
 
 /* Removes PAGE from the LRU list, removes all of its entries from