]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-fs: Added fs_write_stream_abort_async()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 1 Jun 2016 12:15:19 +0000 (15:15 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 1 Jun 2016 12:15:19 +0000 (15:15 +0300)
src/lib-fs/fs-api.c
src/lib-fs/fs-api.h

index f124b2b1026c3e2e260dfe2efe9560336c6fa2c2..d371a604d77db9bb5bdbee00b138e3488f2aeaba 100644 (file)
@@ -707,6 +707,13 @@ void fs_write_stream_abort(struct fs_file *file, struct ostream **output)
        (void)fs_write_stream_finish_int(file, FALSE);
 }
 
+void fs_write_stream_abort_async(struct fs_file *file)
+{
+       i_assert(file->output == NULL);
+
+       fs_write_stream_abort(file, &file->output);
+}
+
 void fs_write_set_hash(struct fs_file *file, const struct hash_method *method,
                       const void *digest)
 {
index 486e7fdf17677f99e90382e12badd378d766f308..92a32fc5f42e4fcaf5db85c3baa2cb58805c1c92 100644 (file)
@@ -270,6 +270,9 @@ int fs_write_stream_finish_async(struct fs_file *file);
    o_stream_ignore_last_errors() is called on the output stream so the caller
    doesn't need to do it. */
 void fs_write_stream_abort(struct fs_file *file, struct ostream **output);
+/* Abort writing to a stream after fs_write_stream_finish() was already
+   called. */
+void fs_write_stream_abort_async(struct fs_file *file);
 
 /* Set a hash to the following write. The storage can then verify that the
    input data matches the specified hash, or fail if it doesn't. Typically