[Groonga-commit] groonga/groonga at 2e4b3cc [master] Expand GRN_API_ENTER/RETURN scope

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Jul 6 22:44:33 JST 2013


Kouhei Sutou	2013-07-06 22:44:33 +0900 (Sat, 06 Jul 2013)

  New Revision: 2e4b3ccd96a2f34f53942402f13f35ad3175f5a6
  https://github.com/groonga/groonga/commit/2e4b3ccd96a2f34f53942402f13f35ad3175f5a6

  Message:
    Expand GRN_API_ENTER/RETURN scope
    
    grn_plugin_path() should be called in GRN_API_ENTER/RETURN scope
    because grn_plugin_path() doesn't call GRN_API_ENTER/RETURN by itself.
    
    Note that it is correct that grn_plugin_path() isn't called in
    GRN_API_RETURN() argument. If it is called in GRN_API_RETURN()
    argument, grn_plugin_path() is called in out of GRN_API_ENTER/RETURN
    scope.

  Modified files:
    lib/db.c

  Modified: lib/db.c (+4 -3)
===================================================================
--- lib/db.c    2013-07-06 22:39:54 +0900 (16cf558)
+++ lib/db.c    2013-07-06 22:44:33 +0900 (9a8bedd)
@@ -7530,11 +7530,12 @@ const char *
 grn_obj_path(grn_ctx *ctx, grn_obj *obj)
 {
   grn_io *io;
-  char *path = NULL;
+  const char *path = NULL;
+  GRN_API_ENTER;
   if (obj->header.type == GRN_PROC) {
-    return grn_plugin_path(ctx, DB_OBJ(obj)->range);
+    path = grn_plugin_path(ctx, DB_OBJ(obj)->range);
+    GRN_API_RETURN(path);
   }
-  GRN_API_ENTER;
   io = grn_obj_io(obj);
   if (io && !(io->flags & GRN_IO_TEMPORARY)) { path = io->path; }
   GRN_API_RETURN(path);
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index