[Groonga-commit] groonga/groonga [master] grn_ii_buffer: stop using pread.

Back to archive index

null+****@clear***** null+****@clear*****
2012年 2月 22日 (水) 19:30:46 JST


Daijiro MORI	2012-02-22 19:30:46 +0900 (Wed, 22 Feb 2012)

  New Revision: d7f37c24a7343c6277fc6c7d47aa394aa82a45c6

  Log:
    grn_ii_buffer: stop using pread.

  Modified files:
    lib/ii.c

  Modified: lib/ii.c (+8 -1)
===================================================================
--- lib/ii.c    2012-02-22 18:26:49 +0900 (f2969dc)
+++ lib/ii.c    2012-02-22 19:30:46 +0900 (c389f5d)
@@ -6785,7 +6785,14 @@ grn_ii_buffer_fetch(grn_ctx *ctx, grn_ii_buffer *ii_buffer,
           return;
         }
       }
-      pread(ii_buffer->tmpfd, block->buffer, bytesize, block->head);
+      if (lseek(ii_buffer->tmpfd, block->head, SEEK_SET) != block->head) {
+        SERR("lseek");
+        return;
+      }
+      if (read(ii_buffer->tmpfd, block->buffer, bytesize) != bytesize) {
+        SERR("read");
+        return;
+      }
       block->head += bytesize;
       block->bufcur = block->buffer;
       if (block->head >= block->tail) {




Groonga-commit メーリングリストの案内
Back to archive index