]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: iostream-temp allows now calling o_stream_seek() on it.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 29 Feb 2016 20:10:06 +0000 (22:10 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 1 Mar 2016 14:08:51 +0000 (16:08 +0200)
src/lib/iostream-temp.c

index 2b15f2c45cb377b975b71c1a7afe673274bef0f3..5fe4fc4b5a8f2a2ed3b6795e857a56fa2f730655 100644 (file)
@@ -216,6 +216,12 @@ o_stream_temp_write_at(struct ostream_private *stream,
        return 0;
 }
 
+static int o_stream_temp_seek(struct ostream_private *_stream, uoff_t offset)
+{
+       _stream->ostream.offset = offset;
+       return 0;
+}
+
 struct ostream *iostream_temp_create(const char *temp_path_prefix,
                                     enum iostream_temp_flags flags)
 {
@@ -242,6 +248,7 @@ struct ostream *iostream_temp_create_sized(const char *temp_path_prefix,
        tstream->ostream.sendv = o_stream_temp_sendv;
        tstream->ostream.send_istream = o_stream_temp_send_istream;
        tstream->ostream.write_at = o_stream_temp_write_at;
+       tstream->ostream.seek = o_stream_temp_seek;
        tstream->ostream.iostream.close = o_stream_temp_close;
        tstream->temp_path_prefix = i_strdup(temp_path_prefix);
        tstream->flags = flags;