Kouhei Sutou
null+****@clear*****
Thu Apr 16 22:19:51 JST 2015
Kouhei Sutou 2015-04-16 22:19:51 +0900 (Thu, 16 Apr 2015) New Revision: 8c04bb90590715797aa74dd2d740e638cff5f4f5 https://github.com/groonga/groonga/commit/8c04bb90590715797aa74dd2d740e638cff5f4f5 Message: Show more information on lseek() error Modified files: lib/grn.h lib/ii.c Modified: lib/grn.h (+2 -0) =================================================================== --- lib/grn.h 2015-04-16 21:47:42 +0900 (4482e16) +++ lib/grn.h 2015-04-16 22:19:51 +0900 (f7c5446) @@ -458,12 +458,14 @@ typedef int grn_cond; # else /* WIN64 */ # define GRN_FMT_SOCKET "u" # endif /* WIN64 */ +# define GRN_FMT_OFF_T GRN_FMT_LLD #else /* WIN32 */ # define GRN_FMT_LLD "lld" # define GRN_FMT_LLU "llu" # define GRN_FMT_SIZE "zu" # define GRN_FMT_SSIZE "zd" # define GRN_FMT_SOCKET "d" +# define GRN_FMT_OFF_T "jd" #endif /* WIN32 */ #ifdef __GNUC__ Modified: lib/ii.c (+11 -3) =================================================================== --- lib/ii.c 2015-04-16 21:47:42 +0900 (83a5b52) +++ lib/ii.c 2015-04-16 22:19:51 +0900 (ad60a1f) @@ -7401,9 +7401,17 @@ grn_ii_buffer_fetch(grn_ctx *ctx, grn_ii_buffer *ii_buffer, return; } } - if (grn_lseek(ii_buffer->tmpfd, block->head, SEEK_SET) != block->head) { - ERRNO_ERR("grn_lseek"); - return; + { + off_t seeked_position; + seeked_position = grn_lseek(ii_buffer->tmpfd, block->head, SEEK_SET); + if (seeked_position != block->head) { + ERRNO_ERR("grn_lseek"); + GRN_LOG(ctx, GRN_LOG_ERROR, + "failed to grn_lseek(%" GRN_FMT_OFF_T ") -> %" GRN_FMT_OFF_T, + block->head, + seeked_position); + return; + } } if (grn_read(ii_buffer->tmpfd, block->buffer, bytesize) != bytesize) { SERR("read"); -------------- next part -------------- HTML����������������������������... 다운로드