mirror of
https://github.com/boostorg/interprocess.git
synced 2026-01-19 04:12:13 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user