From b44d1a08c1d9408ae599c7e48e9a01a346b438e5 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 16 Feb 2018 14:26:11 +0200 Subject: [PATCH] lib: Add o_stream_uncork_flush() to both uncork and flush --- src/lib/ostream.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/ostream.h b/src/lib/ostream.h index 9e76f98db3..c706b3fb87 100644 --- a/src/lib/ostream.h +++ b/src/lib/ostream.h @@ -136,6 +136,13 @@ bool o_stream_is_corked(struct ostream *stream); the stream had overflown, return error. Returns 1 if all data is sent, 0 there's still buffered data, -1 if error. */ int o_stream_flush(struct ostream *stream); +/* Wrapper to easily both uncork and flush. */ +static inline int o_stream_uncork_flush(struct ostream *stream) +{ + o_stream_uncork(stream); + return o_stream_flush(stream); +} + /* Set "flush pending" state of stream. If set, the flush callback is called when more data is allowed to be sent, even if the buffer itself is empty. */ void o_stream_set_flush_pending(struct ostream *stream, bool set); -- 2.47.3