summaryrefslogtreecommitdiff
path: root/lib/Handle.cc
diff options
context:
space:
mode:
authorpixel <pixel>2003-12-11 16:53:27 +0000
committerpixel <pixel>2003-12-11 16:53:27 +0000
commit9a5eedd11cc043fd09c96d57eb901fb85fc1655d (patch)
tree5e9c23c8470c4f2d033adcec0f96e86327d8a824 /lib/Handle.cc
parentd0e8204e8917d189c7365c03af473e18766cc637 (diff)
Linux ports
Diffstat (limited to 'lib/Handle.cc')
-rw-r--r--lib/Handle.cc46
1 files changed, 23 insertions, 23 deletions
diff --git a/lib/Handle.cc b/lib/Handle.cc
index d18a2e4..1696a3e 100644
--- a/lib/Handle.cc
+++ b/lib/Handle.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: Handle.cc,v 1.64 2003-12-07 05:50:41 pixel Exp $ */
+/* $Id: Handle.cc,v 1.65 2003-12-11 16:53:28 pixel Exp $ */
#include <stdio.h>
#include <string.h>
@@ -581,27 +581,27 @@ void * Handle::mmap(off_t offset, size_t length) throw (GeneralException) {
throw GeneralException(String("Was not able to mmap(): ") + strerror(errno));
}
#else
- hMapObject = CreateFileMapping(
- hFile,
- 0,
- CanWrite() ? PAGE_READWRITE : PAGE_READONLY,
- 0,
- length,
- GetName().to_charp());
- if (hMapObject != NULL) {
- r = MapViewOfFile(
- hMapObject,
- CanWrite() ? FILE_MAP_WRITE : FILE_MAP_READ,
- 0,
- offset,
- length);
- if (!r) {
- CloseHandle(hMapObject);
- throw GeneralException("Was not able to MapViewOfFile()");
- }
- } else {
- throw GeneralException("Was not able to CreateFileMapping()");
- }
+ hMapObject = CreateFileMapping(
+ hFile,
+ 0,
+ CanWrite() ? PAGE_READWRITE : PAGE_READONLY,
+ 0,
+ length,
+ GetName().to_charp());
+ if (hMapObject != NULL) {
+ r = MapViewOfFile(
+ hMapObject,
+ CanWrite() ? FILE_MAP_WRITE : FILE_MAP_READ,
+ 0,
+ offset,
+ length);
+ if (!r) {
+ CloseHandle(hMapObject);
+ throw GeneralException("Was not able to MapViewOfFile()");
+ }
+ } else {
+ throw GeneralException("Was not able to CreateFileMapping()");
+ }
#endif
mappedarea = r;
@@ -621,7 +621,7 @@ void Handle::munmap() throw (GeneralException) {
if (!UnmapViewOfFile(mappedarea)) {
throw GeneralException("Was not able to UnmapViewOfFile()");
}
- CloseHandle(hMapObject);
+ CloseHandle(hMapObject);
#endif
mapped = false;
mappedarea = 0;