[Groonga-commit] groonga/groonga at 1f56366 [master] ii offline construction: use O_BINARY on Windows

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Oct 26 18:07:40 JST 2014


Kouhei Sutou	2014-10-26 18:07:40 +0900 (Sun, 26 Oct 2014)

  New Revision: 1f56366d8874d84003b30fdb48c67ed79fcb3f91
  https://github.com/groonga/groonga/commit/1f56366d8874d84003b30fdb48c67ed79fcb3f91

  Message:
    ii offline construction: use O_BINARY on Windows

  Modified files:
    lib/ii.c

  Modified: lib/ii.c (+5 -1)
===================================================================
--- lib/ii.c    2014-10-26 17:09:33 +0900 (9110817)
+++ lib/ii.c    2014-10-26 18:07:40 +0900 (f859627)
@@ -7165,11 +7165,15 @@ grn_ii_buffer_open(grn_ctx *ctx, grn_ii *ii,
       if (ii_buffer->counters) {
         ii_buffer->block_buf = GRN_MALLOCN(grn_id, II_BUFFER_BLOCK_SIZE);
         if (ii_buffer->block_buf) {
+          int open_flags = O_WRONLY|O_CREAT|O_TRUNC;
+#ifdef WIN32
+          open_flags |= O_BINARY;
+#endif
           snprintf(ii_buffer->tmpfpath, PATH_MAX,
                    "%sXXXXXX", grn_io_path(ii->seg));
           ii_buffer->block_buf_size = II_BUFFER_BLOCK_SIZE;
           ii_buffer->tmpfd = GRN_MKOSTEMP(ii_buffer->tmpfpath,
-                                          O_WRONLY|O_CREAT|O_TRUNC,
+                                          open_flags,
                                           S_IRUSR|S_IWUSR);
           if (ii_buffer->tmpfd != -1) {
             grn_obj_flags flags;
-------------- next part --------------
HTML����������������������������...
다운로드 



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