]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: iostream-temp makes the internal fd visible now to o_stream_get_fd()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 24 Feb 2016 14:39:25 +0000 (16:39 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 24 Feb 2016 14:39:25 +0000 (16:39 +0200)
Mainly for the following unit test.

src/lib/iostream-temp.c

index 134362c9f2071c59440a49e556106c5231953b2e..2b15f2c45cb377b975b71c1a7afe673274bef0f3 100644 (file)
@@ -68,6 +68,9 @@ static int o_stream_temp_move_to_fd(struct temp_ostream *tstream)
                i_close_fd(&tstream->fd);
                return -1;
        }
+       /* make the fd available also to o_stream_get_fd(),
+          e.g. for unit tests */
+       tstream->ostream.fd = tstream->fd;
        tstream->fd_size = tstream->buf->used;
        buffer_free(&tstream->buf);
        return 0;