[Groonga-commit] groonga/groonga at 60fc83b [master] Fix return value

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jul 21 15:33:29 JST 2014


Kouhei Sutou	2014-07-21 15:33:29 +0900 (Mon, 21 Jul 2014)

  New Revision: 60fc83b6fc1e8be2e178ff21ba58fd929eef847f
  https://github.com/groonga/groonga/commit/60fc83b6fc1e8be2e178ff21ba58fd929eef847f

  Message:
    Fix return value

  Modified files:
    doc/source/reference/api/plugin.rst
    lib/plugin.c

  Modified: doc/source/reference/api/plugin.rst (+2 -1)
===================================================================
--- doc/source/reference/api/plugin.rst    2014-07-21 15:20:24 +0900 (8b74a63)
+++ doc/source/reference/api/plugin.rst    2014-07-21 15:33:29 +0900 (ccbf591)
@@ -141,4 +141,5 @@ Reference
    :param func: The function name to be called by the created command.
    :param n_vars: The number of the variables of the command to create.
    :param vars:  The pointer of initialized `grn_expr_var` object.
-   :return: ``GRN_SUCCESS``. It doesn't fail.
+   :return: The created command object if it creates a command successfully,
+            `NULL` otherwise. See `ctx` for error details.

  Modified: lib/plugin.c (+4 -3)
===================================================================
--- lib/plugin.c    2014-07-21 15:20:24 +0900 (1e206b1)
+++ lib/plugin.c    2014-07-21 15:33:29 +0900 (26e4a3d)
@@ -745,8 +745,9 @@ grn_plugin_command_create(grn_ctx *ctx,
                           unsigned int n_vars,
                           grn_expr_var *vars)
 {
+  grn_obj *proc;
   name_size = compute_name_size(name, name_size);
-  grn_proc_create(ctx, name, name_size, GRN_PROC_COMMAND,
-                  func, NULL, NULL, n_vars, vars);
-  return GRN_SUCCESS;
+  proc = grn_proc_create(ctx, name, name_size, GRN_PROC_COMMAND,
+                         func, NULL, NULL, n_vars, vars);
+  return proc;
 }
-------------- next part --------------
HTML����������������������������...
Download 



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