Add FILE_FLAG_OVERLAPPED in a couple of places
authorMikko Rasa <tdb@tdb.fi>
Sat, 18 Jun 2011 18:33:48 +0000 (21:33 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 18 Jun 2011 18:36:07 +0000 (21:36 +0300)
source/io/pipe.cpp
source/io/serial.cpp

index d8de5df2745ca60a1ad0f74912d767435b2f5a4a..b52c2bcb33131e02fc2a0d28f39aabc3e3e62593 100644 (file)
@@ -21,7 +21,7 @@ Pipe::Pipe():
        if(!handle[0])
                throw system_error("CreateNamedPipe");
 
-       *handle[1] = CreateFile(name.c_str(), GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
+       *handle[1] = CreateFile(name.c_str(), GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0);
        if(!handle[1])
        {
                unsigned err = GetLastError();
index ac4f2b764d8666332de5cf932e62e66cd5d764b2..2ed11ae9fddd900b4ab695a2acc05770deaf5e18 100644 (file)
@@ -158,7 +158,7 @@ Serial::Serial(const string &descr):
 #ifdef WIN32
        port = "\\\\.\\"+port;
 
-       *handle = CreateFile(port.c_str(), GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+       *handle = CreateFile(port.c_str(), GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED, 0);
        if(!handle)
                throw system_error(format("CreateFile(%s)", port));
        mode = M_READ|M_WRITE;