Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@www.apache.org Received: (qmail 20997 invoked from network); 13 Oct 2004 17:19:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 13 Oct 2004 17:19:12 -0000 Received: (qmail 98328 invoked by uid 500); 13 Oct 2004 17:19:08 -0000 Delivered-To: apmail-jakarta-lucene-dev-archive@jakarta.apache.org Received: (qmail 98294 invoked by uid 500); 13 Oct 2004 17:19:08 -0000 Mailing-List: contact lucene-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Developers List" Reply-To: "Lucene Developers List" Delivered-To: mailing list lucene-dev@jakarta.apache.org Received: (qmail 98281 invoked by uid 500); 13 Oct 2004 17:19:08 -0000 Received: (qmail 98275 invoked by uid 99); 13 Oct 2004 17:19:07 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 13 Oct 2004 10:19:07 -0700 Received: (qmail 20937 invoked by uid 1209); 13 Oct 2004 17:19:06 -0000 Date: 13 Oct 2004 17:19:06 -0000 Message-ID: <20041013171906.20936.qmail@minotaur.apache.org> From: cutting@apache.org To: jakarta-lucene-cvs@apache.org Subject: cvs commit: jakarta-lucene/src/gcj/org/apache/lucene/store GCJIndexInput.cc X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N cutting 2004/10/13 10:19:06 Modified: src/gcj/org/apache/lucene/store GCJIndexInput.cc Log: Correctly translate errors from mmap() into exceptions. Revision Changes Path 1.2 +4 -2 jakarta-lucene/src/gcj/org/apache/lucene/store/GCJIndexInput.cc Index: GCJIndexInput.cc =================================================================== RCS file: /home/cvs/jakarta-lucene/src/gcj/org/apache/lucene/store/GCJIndexInput.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- GCJIndexInput.cc 20 Sep 2004 18:14:25 -0000 1.1 +++ GCJIndexInput.cc 13 Oct 2004 17:19:06 -0000 1.2 @@ -39,11 +39,13 @@ fileLength = sb.st_size; // mmap the file - data = RAW(::mmap(0, fileLength, PROT_READ, MAP_SHARED, fd, 0)); - if (data < 0) + // cout << "mmapping " << buf << "\n"; + void* address = ::mmap(0, fileLength, PROT_READ, MAP_SHARED, fd, 0); + if (address == MAP_FAILED) throw new IOException(JvNewStringLatin1(strerror(errno))); // initialize pointer to the start of the file + data = RAW(address); pointer = data; } --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-dev-help@jakarta.apache.org