iostream: make close() flush

This change is intended to make close() flush the stream before
proceeding with the close itself. This improves the situation
where we have to guarantee that the stream is flushed before
closing it.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
This commit is contained in:
Raphael S. Carvalho
2015-05-04 12:23:23 -03:00
committed by Avi Kivity
parent 061de14d01
commit 36701cafcb

View File

@@ -173,7 +173,7 @@ public:
future<> write(net::packet p);
future<> write(scattered_message<char_type> msg);
future<> flush();
future<> close() { return _fd.close(); }
future<> close() { return flush().then([this] { return _fd.close(); }); }
private:
};