From 84eae872a93080596d2410bd3061d2d2edfd4c74 Mon Sep 17 00:00:00 2001 From: Jonathan Turkanis Date: Fri, 4 Feb 2005 20:52:42 +0000 Subject: [PATCH] eliminated non-standard flag MAP_FILE in fourth arg to mmap [SVN r27100] --- src/mapped_file.cpp | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/mapped_file.cpp b/src/mapped_file.cpp index 60ab02f..54e7d60 100755 --- a/src/mapped_file.cpp +++ b/src/mapped_file.cpp @@ -15,9 +15,6 @@ #include #include #include -// BEGIN DEBUG -//#include -// END DEBUG #ifdef BOOST_IOSTREAMS_WINDOWS # define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers @@ -59,9 +56,6 @@ struct mapped_file_impl { ::CloseHandle(mapped_handle_); ::CloseHandle(handle_); error_ = ::GetLastError() != 0; - // BEGIN DEBUG - //std::cout << "closing file: error = " << ::GetLastError() << "\n"; - // END DEBUG #else errno = 0; ::munmap(reinterpret_cast(data_), size_); @@ -142,22 +136,12 @@ void mapped_file_source::open( const std::string& path, std::ios::openmode mode, //--------------Open underlying file--------------------------------------// - - // BEGIN DEBUG - //SetLastError(0); - //std::cout << "about to open file " << path.c_str() << "\n"; - // END DEBUG - pimpl_->handle_ = ::CreateFileA( path.c_str(), readonly ? GENERIC_READ : GENERIC_ALL, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL ); if (pimpl_->handle_ == INVALID_HANDLE_VALUE) { pimpl_->clear(true); - // BEGIN DEBUG - //std::cout << "failed opening file " << path.c_str() << std::endl; - //std::cout << "GetLastError() == " << GetLastError() << std::endl; - // END DEBUG return; } @@ -170,9 +154,6 @@ void mapped_file_source::open( const std::string& path, std::ios::openmode mode, if (pimpl_->mapped_handle_ == NULL) { ::CloseHandle(pimpl_->handle_); pimpl_->clear(true); - // BEGIN DEBUG - //std::cout << "failed creating mapping for file " << path.c_str() << std::endl; - // END DEBUG return; } @@ -186,9 +167,6 @@ void mapped_file_source::open( const std::string& path, std::ios::openmode mode, length != max_length ? length : 0, 0 ); if (!data) { close_handles(*pimpl_); - // BEGIN DEBUG - //std::cout << "failed mapping view for for file " << path.c_str() <size_, readonly ? PROT_READ : PROT_WRITE, - MAP_SHARED | MAP_FILE, - // readonly ? MAP_PRIVATE : MAP_SHARED, + readonly ? MAP_PRIVATE : MAP_SHARED, pimpl_->handle_, offset ); if (data == MAP_FAILED) { ::close(pimpl_->handle_);