Kouhei Sutou
null+****@clear*****
Mon Jun 5 16:36:54 JST 2017
Kouhei Sutou 2017-06-05 16:36:54 +0900 (Mon, 05 Jun 2017) New Revision: ad7cdc63a5fabbe462f4083ba7682656e82b013c https://github.com/groonga/groonga/commit/ad7cdc63a5fabbe462f4083ba7682656e82b013c Message: Improve unlink error handling Modified files: lib/io.c Modified: lib/io.c (+4 -6) =================================================================== --- lib/io.c 2017-06-05 16:34:31 +0900 (bbdc41b) +++ lib/io.c 2017-06-05 16:36:54 +0900 (7ba2c8b) @@ -359,13 +359,11 @@ grn_io_create(grn_ctx *ctx, const char *path, uint32_t header_size, GRN_MUNMAP(ctx, &grn_gctx, NULL, &fis->fmo, fis, header, b); } grn_fileinfo_close(ctx, fis); - if (grn_unlink(path) == -1) { - GRN_LOG(ctx, GRN_LOG_ERROR, - "failed to grn_unlink() path on grn_io_create() error: " - "<%s>: <%s>", - path, grn_strerror(errno)); + if (grn_unlink(path) == 0) { + GRN_LOG(ctx, GRN_LOG_INFO, + "[io][create][error] removed path: <%s>", path); } else { - GRN_LOG(ctx, GRN_LOG_INFO, "removed path on grn_io_create(): <%s>", path); + ERRNO_ERR("[io][create][error] failed to remove path: <%s>", path); } } GRN_FREE(fis); -------------- next part -------------- HTML����������������������������...Télécharger