diff options
| -rw-r--r-- | libadhocutil/fileUtils.cpp | 5 | ||||
| -rw-r--r-- | libadhocutil/fileUtils.h | 3 | 
2 files changed, 4 insertions, 4 deletions
| diff --git a/libadhocutil/fileUtils.cpp b/libadhocutil/fileUtils.cpp index 0cd3382..7b90e4b 100644 --- a/libadhocutil/fileUtils.cpp +++ b/libadhocutil/fileUtils.cpp @@ -1,5 +1,4 @@  #include "fileUtils.h" -#include <fcntl.h>  #include <unistd.h>  #include <sys/mman.h> @@ -12,8 +11,8 @@ namespace AdHoc {  			return *pp;  		} -		FileHandle::FileHandle(const boost::filesystem::path & path) : -			fh(open(path.c_str(), O_RDONLY)) +		FileHandle::FileHandle(const boost::filesystem::path & path, int flags) : +			fh(open(path.c_str(), flags))  		{  			if (fh < 0) {  				throw std::runtime_error("Failed to open " + path.string()); diff --git a/libadhocutil/fileUtils.h b/libadhocutil/fileUtils.h index a11accb..3fa5756 100644 --- a/libadhocutil/fileUtils.h +++ b/libadhocutil/fileUtils.h @@ -3,6 +3,7 @@  #include <boost/filesystem/path.hpp>  #include <sys/stat.h> +#include <fcntl.h>  #include "visibility.h"  namespace AdHoc { @@ -11,7 +12,7 @@ namespace AdHoc {  		class DLL_PUBLIC FileHandle {  			public: -				FileHandle(const boost::filesystem::path & path); +				FileHandle(const boost::filesystem::path & path, int flags = O_RDONLY);  				virtual ~FileHandle();  				const int fh; | 
