|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62972 - trunk/libs/iostreams/src
From: steven_at_[hidden]
Date: 2010-06-15 10:43:21
Author: steven_watanabe
Date: 2010-06-15 10:43:20 EDT (Tue, 15 Jun 2010)
New Revision: 62972
URL: http://svn.boost.org/trac/boost/changeset/62972
Log:
Fix openmode error handling for Posix systems.
Text files modified:
trunk/libs/iostreams/src/file_descriptor.cpp | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
Modified: trunk/libs/iostreams/src/file_descriptor.cpp
==============================================================================
--- trunk/libs/iostreams/src/file_descriptor.cpp (original)
+++ trunk/libs/iostreams/src/file_descriptor.cpp 2010-06-15 10:43:20 EDT (Tue, 15 Jun 2010)
@@ -183,7 +183,7 @@
boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad open mode"));
oflag |= O_RDONLY;
} else if (mode & BOOST_IOS::out) {
- if( mode & (BOOST_IOS::app | BOOST_IOS::trunc)
+ if( (mode & (BOOST_IOS::app | BOOST_IOS::trunc))
==
(BOOST_IOS::app | BOOST_IOS::trunc) )
boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad open mode"));
@@ -194,6 +194,8 @@
oflag |= O_CREAT;
oflag |= O_TRUNC;
}
+ } else {
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad open mode"));
}
#ifdef _LARGEFILE64_SOURCE
oflag |= O_LARGEFILE;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk