Fix interprocess_exception throw in file_wrapper::priv_open_or_create.

On Windows the exception object is created using the result of GetLastError().
When compiled using MinGW the throw instruction itself is using some WinApi call which overwrites the last error.
Therefore the error code must be retrieved before the exception is thrown.
This commit is contained in:
Adam Wulkiewicz
2014-05-25 17:13:35 +02:00
parent 58078fad47
commit f1e1af0a47

View File

@@ -167,7 +167,8 @@ inline bool file_wrapper::priv_open_or_create
//Check for error
if(m_handle == invalid_file()){
throw interprocess_exception(error_info(system_error_code()));
error_info err(system_error_code());
throw interprocess_exception(err);
}
m_mode = mode;