Skip to content

Commit 223df5e

Browse files
committed
Reverted use of ENOINT on linux -- g++-4.8 does not support failure with error code.
1 parent 4ecfb2e commit 223df5e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Release/src/streams/linux/fileio_linux.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class io_scheduler
7373
void submit_io()
7474
{
7575
m_no_outstanding_work.reset();
76-
++m_outstanding_work;
76+
++m_outstanding_work;
7777
}
7878

7979
void complete_io()
@@ -176,7 +176,7 @@ using namespace Concurrency::streams::details;
176176
/// <returns>The error code if there was an error in file creation.</returns>
177177
bool _finish_create(int fh, _filestream_callback *callback, std::ios_base::openmode mode, int /* prot */)
178178
{
179-
if ( fh != -1 )
179+
if ( fh != -1 )
180180
{
181181
std::shared_ptr<io_scheduler> sched = get_scheduler();
182182

@@ -185,7 +185,7 @@ bool _finish_create(int fh, _filestream_callback *callback, std::ios_base::openm
185185
// letting the OS do its buffering, even if it means that prompt reads won't
186186
// happen.
187187
bool buffer = (mode == std::ios_base::in);
188-
188+
189189
// seek to end if requested
190190
if (mode & std::ios_base::ate)
191191
{
@@ -204,8 +204,11 @@ bool _finish_create(int fh, _filestream_callback *callback, std::ios_base::openm
204204
}
205205
else
206206
{
207-
auto enoint = std::make_error_code(std::errc::no_such_file_or_directory);
208-
auto exptr = std::make_exception_ptr(std::ios_base::failure("failed to create file", enoint));
207+
#ifdef __APPLE__
208+
auto exptr = std::make_exception_ptr(std::ios_base::failure("failed to create file", std::make_error_code(std::errc::no_such_file_or_directory)));
209+
#else
210+
auto exptr = std::make_exception_ptr(std::ios_base::failure("failed to create file"));
211+
#endif
209212
callback->on_error(exptr);
210213
return false;
211214
}

0 commit comments

Comments
 (0)