[Groonga-commit] groonga/groonga at dc54cf4 [master] Improve unlink error handling

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jun 5 16:34:31 JST 2017


Kouhei Sutou	2017-06-05 16:34:31 +0900 (Mon, 05 Jun 2017)

  New Revision: dc54cf4cca52a142f57aa793c930a485b8807999
  https://github.com/groonga/groonga/commit/dc54cf4cca52a142f57aa793c930a485b8807999

  Message:
    Improve unlink error handling

  Modified files:
    lib/ii.c

  Modified: lib/ii.c (+6 -5)
===================================================================
--- lib/ii.c    2017-06-05 16:33:17 +0900 (7a6d20d)
+++ lib/ii.c    2017-06-05 16:34:31 +0900 (013014f)
@@ -11405,12 +11405,13 @@ grn_ii_builder_fin(grn_ctx *ctx, grn_ii_builder *builder)
   }
   if (builder->fd != -1) {
     grn_close(builder->fd);
-    if (grn_unlink(builder->path) != 0) {
-      ERRNO_ERR("failed to remove path on grn_ii_builder_fin(): <%s>",
-                builder->path);
-    } else {
+    if (grn_unlink(builder->path) == 0) {
       GRN_LOG(ctx, GRN_LOG_INFO,
-              "removed path on grn_ii_builder_fin(): <%s>", builder->path);
+              "[ii][builder][fin] removed path: <%s>",
+              builder->path);
+    } else {
+      ERRNO_ERR("[ii][builder][fin] failed to remove path: <%s>",
+                builder->path);
     }
   }
   grn_ii_builder_fin_terms(ctx, builder);
-------------- next part --------------
HTML����������������������������...
Download 



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