]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/pipe.cpp
Fix some stray header names
[libs/core.git] / source / io / pipe.cpp
index 2e37f119aeaf3dc67726341d2047cc30748044d3..3882bd5b79b62eb6159cdd372ddaa4ca9a5e4e18 100644 (file)
@@ -3,7 +3,7 @@
 #include <errno.h>
 #endif
 #include <msp/core/systemerror.h>
-#include <msp/strings/formatter.h>
+#include <msp/strings/format.h>
 #include "handle_private.h"
 #include "pipe.h"
 
@@ -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();
@@ -47,7 +47,6 @@ Pipe::~Pipe()
        signal_flush_required.emit();
        sys_close(handle[0]);
        sys_close(handle[1]);
-       signal_closed.emit();
 }
 
 void Pipe::set_block(bool b)
@@ -78,12 +77,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;
 }