<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    <dl style="line-height: 1.5; margin-left: 2em">
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Author</dt>
      <dd style="margin-left: 8.5em">Kouhei Sutou &lt;kou****@clear*****&gt;</dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Date</dt>
      <dd style="margin-left: 8.5em">2015-04-18 15:49:20 +0900 (Sat, 18 Apr 2015)</dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">New Revision</dt>
      <dd style="margin-left: 8.5em"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c">20ee392230d80c7f421f3fda484963d5b6eaec7c</a></dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Message</dt>
      <dd style="margin-left: 8.5em"><pre style="border: 1px solid #aaa; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; padding: 0.5em; width: auto">Fix error report about open()

open() sets errno.</pre></dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Modified files</dt>
      <dd style="margin-left: 8.5em">
        <ul>
          <li><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#diff-0">lib/ii.c</a></li>
          <li><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#diff-1">lib/io.c</a></li>
        </ul>
      </dd>
    </dl>

    <div class="diff-section" style="clear: both">
      <table style="border-collapse: collapse; border: 1px solid #aaa">
        <thead>
          <tr class="diff-header" style="border: 1px solid #aaa">
            <td colspan="3">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">  Modified: lib/ii.c (+1 -1)</span>
<span class="diff-header-mark" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">===================================================================</span>
</pre>
            </td>
          </tr>
        </thead>
        <tbody>
          <tr>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0L7798">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0L7799">7799</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0L7800">7800</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0L7801">7801</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0L7802">7802</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0L7803">7803</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0L7804">7804</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0L7805">7805</a></span>
</pre>
            </th>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0R7798">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0R7799">7799</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0R7800">7800</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0R7801">7801</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0R7802">7802</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0R7803">7803</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0R7804">7804</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L0R7805">7805</a></span>
</pre>
            </th>
            <td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -7799,7 +7799,7 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">grn_ii_buffer_commit(grn_ctx *ctx, grn_ii_buffer *ii_buffer)</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">   ii_buffer-&gt;tmpfd = GRN_OPEN(ii_buffer-&gt;tmpfpath, O_RDONLY);</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> #endif /* WIN32 */</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   if (ii_buffer-&gt;tmpfd == -1) {</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-    SERR(&quot;oepn&quot;);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+    ERRNO_ERR(&quot;oepn&quot;);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     return ctx-&gt;rc;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   }</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   {</span>
</pre>
            </td>
          </tr>
        </tbody>
      </table>
      <table style="border-collapse: collapse; border: 1px solid #aaa">
        <thead>
          <tr class="diff-header" style="border: 1px solid #aaa">
            <td colspan="3">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">  Modified: lib/io.c (+5 -2)</span>
<span class="diff-header-mark" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">===================================================================</span>
</pre>
            </td>
          </tr>
        </thead>
        <tbody>
          <tr>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L494">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L495">495</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L496">496</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L497">497</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L498">498</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L499">499</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L500">500</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L501">501</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L512">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L513">513</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L514">514</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L515">515</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L516">516</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L517">517</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L518">518</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1L519">519</a></span>
</pre>
            </th>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R494">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R495">495</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R496">496</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R497">497</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R498">498</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R499">499</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R500">500</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R501">501</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R512">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R513">513</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R514">514</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R515">515</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R516">516</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R517">517</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R518">518</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R519">519</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R520">520</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R521">521</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/20ee392230d80c7f421f3fda484963d5b6eaec7c#L1R522">522</a></span>
</pre>
            </th>
            <td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -495,7 +495,7 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">grn_io_detect_type(grn_ctx *ctx, const char *path)</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">     }</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     grn_close(fd);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   } else {</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-    SERR(path);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+    ERRNO_ERR(path);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   }</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   return res;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> }</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -513,7 +513,10 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">grn_io_open(grn_ctx *ctx, const char *path, grn_io_mode mode)</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">   {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     struct _grn_io_header h;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     int fd = GRN_OPEN(path, O_RDWR | O_BINARY);</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-    if (fd == -1) { SERR(path); return NULL; }</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+    if (fd == -1) {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+      ERRNO_ERR(path);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+      return NULL;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+    }</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     if (fstat(fd, &amp;s) != -1 &amp;&amp; s.st_size &gt;= sizeof(struct _grn_io_header)) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       if (grn_read(fd, &amp;h, sizeof(struct _grn_io_header)) == sizeof(struct _grn_io_header)) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         if (!memcmp(h.idstr, GRN_IO_IDSTR, 16)) {</span>
</pre>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>