From: Mikko Rasa Date: Sat, 18 Jun 2011 18:33:48 +0000 (+0300) Subject: Add FILE_FLAG_OVERLAPPED in a couple of places X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=a97f614de0984d6dda2173ca72815ac1062faf7a;p=libs%2Fcore.git Add FILE_FLAG_OVERLAPPED in a couple of places --- diff --git a/source/io/pipe.cpp b/source/io/pipe.cpp index d8de5df..b52c2bc 100644 --- a/source/io/pipe.cpp +++ b/source/io/pipe.cpp @@ -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(); diff --git a/source/io/serial.cpp b/source/io/serial.cpp index ac4f2b7..2ed11ae 100644 --- a/source/io/serial.cpp +++ b/source/io/serial.cpp @@ -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;