]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/pipe.cpp
Add FILE_FLAG_OVERLAPPED in a couple of places
[libs/core.git] / source / io / pipe.cpp
index f52801cd834e550199a808ab99020adcac8d6a27..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();
@@ -41,11 +41,6 @@ Pipe::Pipe():
 }
 
 Pipe::~Pipe()
-{
-       close();
-}
-
-void Pipe::close()
 {
        set_events(P_NONE);
 
@@ -83,12 +78,8 @@ unsigned Pipe::do_read(char *buf, unsigned size)
                return 0;
 
        unsigned ret = reader.read(buf, size);
-
        if(ret==0)
-       {
-               eof_flag = true;
-               signal_end_of_file.emit();
-       }
+               set_eof();
 
        return ret;
 }