diff --git a/core/iostream.hh b/core/iostream.hh index 0122d146bf..1594038a96 100644 --- a/core/iostream.hh +++ b/core/iostream.hh @@ -173,7 +173,7 @@ public: future<> write(net::packet p); future<> write(scattered_message msg); future<> flush(); - future<> close() { return _fd.close(); } + future<> close() { return flush().then([this] { return _fd.close(); }); } private: };