]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Replace o_stream_nfinish() with o_stream_finish() whenever possible
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 27 Oct 2017 22:55:12 +0000 (01:55 +0300)
committerTimo Sirainen <tss@dovecot.fi>
Mon, 30 Oct 2017 11:04:53 +0000 (13:04 +0200)
33 files changed:
src/doveadm/client-connection-http.c
src/doveadm/dsync/dsync-ibc-stream.c
src/lib-compression/test-compression.c
src/lib-dcrypt/test-stream.c
src/lib-dict/dict-file.c
src/lib-fs/fs-api.c
src/lib-index/mail-cache-compress.c
src/lib-index/mail-index-strmap.c
src/lib-index/mail-index-write.c
src/lib-mail/istream-attachment-extractor.c
src/lib-mail/test-istream-attachment.c
src/lib-master/master-instance.c
src/lib-program-client/test-program-client-net.c
src/lib-program-client/test-program-client-unix.c
src/lib-storage/index/cydir/cydir-save.c
src/lib-storage/index/dbox-common/dbox-save.c
src/lib-storage/index/dbox-single/sdbox-file.c
src/lib-storage/index/imapc/imapc-save.c
src/lib-storage/index/maildir/maildir-save.c
src/lib-storage/index/maildir/maildir-uidlist.c
src/lib-storage/list/subscription-file.c
src/lib-storage/mail-duplicate.c
src/lib/test-istream-multiplex.c
src/lib/test-multiplex.c
src/lib/test-ostream-buffer.c
src/lib/test-ostream-file.c
src/lib/test-ostream-multiplex.c
src/plugins/acl/acl-backend-vfile-acllist.c
src/plugins/acl/acl-backend-vfile-update.c
src/plugins/fts-squat/squat-trie.c
src/plugins/fts-squat/squat-uidlist.c
src/replication/replicator/replicator-queue.c
src/util/rawlog.c

index 77594d13336ae4dd3b54cf7839760aba49179c29..3ad6c5ae7d5cec9389f4fd5ce53c8aadf1b32ebf 100644 (file)
@@ -233,7 +233,7 @@ doveadm_http_server_command_execute(struct client_request_http *req)
 
        if ((cctx.cmd->flags & CMD_FLAG_NO_PRINT) == 0)
                doveadm_print_deinit();
-       if (o_stream_nfinish(doveadm_print_ostream) < 0) {
+       if (o_stream_finish(doveadm_print_ostream) < 0) {
                i_info("Error writing output in command %s: %s",
                       req->cmd->name,
                       o_stream_get_error(req->output));
@@ -903,7 +903,7 @@ static void doveadm_http_server_send_response(struct client_request_http *req)
        struct istream *payload = NULL;
 
        if (req->output != NULL) {
-               if (o_stream_nfinish(req->output) == -1) {
+               if (o_stream_finish(req->output) == -1) {
                        i_info("error writing output: %s",
                               o_stream_get_error(req->output));
                        o_stream_destroy(&req->output);
index ccd4b42fb0563e66ee77a5e3fbe3187cc4cfd673..c48f2f3b6087457c91aa631a54c0e68d6e75b5ab 100644 (file)
@@ -384,7 +384,7 @@ static void dsync_ibc_stream_deinit(struct dsync_ibc *_ibc)
                        o_stream_nsend_str(ibc->output,
                                t_strdup_printf("%c\n", items[ITEM_DONE].chr));
                }
-               (void)o_stream_nfinish(ibc->output);
+               (void)o_stream_finish(ibc->output);
        }
 
        timeout_remove(&ibc->to);
index 79fe441e6fafe93d61b3f05da74c6120b8318ead..ff1658c7bf58f3e90c2ad23a04172239e3ce51ee 100644 (file)
@@ -111,13 +111,13 @@ static void test_gz(const char *str1, const char *str2)
 
        output = gz->create_ostream(buf_output, 6);
        o_stream_nsend_str(output, str1);
-       test_assert(o_stream_nfinish(output) == 0);
+       test_assert(o_stream_finish(output) > 0);
        o_stream_destroy(&output);
 
        if (str2[0] != '\0') {
                output = gz->create_ostream(buf_output, 6);
                o_stream_nsend_str(output, "world");
-               test_assert(o_stream_nfinish(output) == 0);
+               test_assert(o_stream_finish(output) > 0);
                o_stream_destroy(&output);
        }
 
@@ -260,7 +260,7 @@ static void test_compress_file(const char *in_path, const char *out_path)
                o_stream_nsend(output, data, size);
                i_stream_skip(input, size);
        }
-       if (o_stream_nfinish(output) < 0) {
+       if (o_stream_finish(output) < 0) {
                i_fatal("write(%s) failed: %s",
                        out_path, o_stream_get_error(output));
        }
index 243e5283943a70aa8d50259060ce8ae75cc49a64..0c071be911192c17f654055936e3cfc4cd7ba396 100644 (file)
@@ -167,7 +167,7 @@ void test_static_v2_input(void)
                i_stream_skip(is_2, siz);
        }
 
-       i_assert(o_stream_nfinish(os_2)==0);
+       i_assert(o_stream_finish(os_2) > 0);
 
        o_stream_close(os_2);
        i_stream_close(is_2);
@@ -195,7 +195,7 @@ void test_write_read_v1(void)
                i_debug("error: %s", o_stream_get_error(os_2));
 
        test_assert(os_2->stream_errno == 0);
-       test_assert(o_stream_nfinish(os_2) == 0);
+       test_assert(o_stream_finish(os_2) > 0);
        test_assert(os_2->stream_errno == 0);
 
        o_stream_unref(&os);
@@ -246,7 +246,7 @@ void test_write_read_v1_short(void)
                i_debug("error: %s", o_stream_get_error(os_2));
 
        test_assert(os_2->stream_errno == 0);
-       test_assert(o_stream_nfinish(os_2) == 0);
+       test_assert(o_stream_finish(os_2) > 0);
        test_assert(os_2->stream_errno == 0);
 
        o_stream_unref(&os);
@@ -288,7 +288,7 @@ void test_write_read_v1_empty(void)
        buffer_t *buf = buffer_create_dynamic(default_pool, 64);
        struct ostream *os = o_stream_create_buffer(buf);
        struct ostream *os_2 = o_stream_create_encrypt(os, "<unused>", test_v1_kp.pub, IO_STREAM_ENC_VERSION_1);
-       test_assert(o_stream_nfinish(os_2) == 0);
+       test_assert(o_stream_finish(os_2) > 0);
        if (os_2->stream_errno != 0)
                i_debug("error: %s", o_stream_get_error(os_2));
 
@@ -334,7 +334,7 @@ void test_write_read_v2(void)
        struct ostream *os = o_stream_create_buffer(buf);
        struct ostream *os_2 = o_stream_create_encrypt(os, "aes-256-gcm-sha256", test_v1_kp.pub, IO_STREAM_ENC_INTEGRITY_AEAD);
        o_stream_nsend(os_2, payload, sizeof(payload));
-       test_assert(o_stream_nfinish(os_2) == 0);
+       test_assert(o_stream_finish(os_2) > 0);
        if (os_2->stream_errno != 0)
                i_debug("error: %s", o_stream_get_error(os_2));
 
@@ -387,7 +387,7 @@ void test_write_read_v2_short(void)
        struct ostream *os = o_stream_create_buffer(buf);
        struct ostream *os_2 = o_stream_create_encrypt(os, "aes-256-gcm-sha256", test_v1_kp.pub, IO_STREAM_ENC_INTEGRITY_AEAD);
        o_stream_nsend(os_2, payload, sizeof(payload));
-       test_assert(o_stream_nfinish(os_2) == 0);
+       test_assert(o_stream_finish(os_2) > 0);
        if (os_2->stream_errno != 0)
                i_debug("error: %s", o_stream_get_error(os_2));
 
@@ -431,7 +431,7 @@ void test_write_read_v2_empty(void)
        buffer_t *buf = buffer_create_dynamic(default_pool, 64);
        struct ostream *os = o_stream_create_buffer(buf);
        struct ostream *os_2 = o_stream_create_encrypt(os, "aes-256-gcm-sha256", test_v1_kp.pub, IO_STREAM_ENC_INTEGRITY_AEAD);
-       test_assert(o_stream_nfinish(os_2) == 0);
+       test_assert(o_stream_finish(os_2) > 0);
        if (os_2->stream_errno != 0)
                i_debug("error: %s", o_stream_get_error(os_2));
 
index 6c16f1d435626f2cba7d52553fde7e1ba2eff0b0..9d3701667549cff1ea82daaca94980e565862158 100644 (file)
@@ -590,7 +590,7 @@ file_dict_write_changes(struct dict_transaction_memory_context *ctx,
        }
        hash_table_iterate_deinit(&iter);
 
-       if (o_stream_nfinish(output) < 0) {
+       if (o_stream_finish(output) <= 0) {
                *error_r = t_strdup_printf("write(%s) failed: %s", temp_path,
                                           o_stream_get_error(output));
                o_stream_destroy(&output);
index bd30e600e2ce069f758f8eb71c2b84f871268ec5..ab5d6846d3d5041fb239f16586cec19be58d1d0a 100644 (file)
@@ -736,6 +736,7 @@ static int fs_write_stream_finish_int(struct fs_file *file, bool success)
 int fs_write_stream_finish(struct fs_file *file, struct ostream **output)
 {
        bool success = TRUE;
+       int ret;
 
        i_assert(*output == file->output || *output == NULL);
        i_assert(output != &file->output);
@@ -743,7 +744,8 @@ int fs_write_stream_finish(struct fs_file *file, struct ostream **output)
        *output = NULL;
        if (file->output != NULL) {
                o_stream_uncork(file->output);
-               if (o_stream_nfinish(file->output) < 0) {
+               if ((ret = o_stream_finish(file->output)) <= 0) {
+                       i_assert(ret < 0);
                        fs_set_error(file->fs, "write(%s) failed: %s",
                                     o_stream_get_name(file->output),
                                     o_stream_get_error(file->output));
index 6cd6ba1b317e63eee94fe121a50d209d1efdcc73..8712bb30bcf76365231c4af4989ebcb2a11bb80e 100644 (file)
@@ -304,7 +304,7 @@ mail_cache_copy(struct mail_cache *cache, struct mail_index_transaction *trans,
 
        mail_cache_view_close(&cache_view);
 
-       if (o_stream_nfinish(output) < 0) {
+       if (o_stream_finish(output) < 0) {
                mail_cache_set_syscall_error(cache, "write()");
                o_stream_destroy(&output);
                array_free(ext_offsets);
index 63958db554879c4dc70b91894540899f5ae5b1cd..0b2fc1aae8fc21fd20e50b3c2c393c633c5cf459 100644 (file)
@@ -1015,7 +1015,7 @@ static int mail_index_strmap_recreate(struct mail_index_strmap_view *view)
        output = o_stream_create_fd(fd, 0);
        o_stream_cork(output);
        mail_index_strmap_recreate_write(view, output);
-       if (o_stream_nfinish(output) < 0) {
+       if (o_stream_finish(output) < 0) {
                mail_index_set_error(strmap->index, "write(%s) failed: %s",
                                     temp_path, o_stream_get_error(output));
                ret = -1;
@@ -1171,7 +1171,7 @@ mail_index_strmap_write_append(struct mail_index_strmap_view *view)
        o_stream_cork(output);
        mail_index_strmap_write_block(view, output, i,
                                      view->last_read_uid + 1);
-       if (o_stream_nfinish(output) < 0) {
+       if (o_stream_finish(output) < 0) {
                mail_index_strmap_set_syscall_error(view->strmap, "write()");
                ret = -1;
        }
index b01ef80f2870ca1d2d5b4c1d91a63290db07d06a..accb456c0d38c57b269da3cae93db8cc2fe6169e 100644 (file)
@@ -83,7 +83,7 @@ static int mail_index_recreate(struct mail_index *index)
                       map->hdr.header_size - base_size);
        o_stream_nsend(output, map->rec_map->records,
                       map->rec_map->records_count * map->hdr.record_size);
-       if (o_stream_nfinish(output) < 0) {
+       if (o_stream_finish(output) < 0) {
                mail_index_file_set_syscall_error(index, path, "write()");
                ret = -1;
        }
index b1b4026e5eebea74e7c7ba16d7156ab2e4caeb82..3f59b7e6d09c4624002004d039eef64f6d5e31d1 100644 (file)
@@ -398,7 +398,7 @@ static int astream_decode_base64(struct attachment_istream *astream)
                        i_stream_get_error(base64_input));
                failed = TRUE;
        }
-       if (o_stream_nfinish(output) < 0) {
+       if (o_stream_finish(output) < 0) {
                i_error("istream-attachment: write(%s) failed: %s",
                        o_stream_get_name(output), o_stream_get_error(output));
                failed = TRUE;
@@ -454,7 +454,7 @@ astream_part_finish(struct attachment_istream *astream, const char **error_r)
        size_t size;
        int ret = 0;
 
-       if (o_stream_nfinish(part->temp_output) < 0) {
+       if (o_stream_finish(part->temp_output) < 0) {
                *error_r = t_strdup_printf("write(%s) failed: %s",
                                           o_stream_get_name(part->temp_output),
                                           o_stream_get_error(part->temp_output));
index d97bcf5f5b2000fa2b6caf37f53103e16f2bd000..16529138c78b7fea3464f7cab7eb7a397d804353 100644 (file)
@@ -181,7 +181,7 @@ static int test_close_attachment_ostream(struct ostream *output, bool success,
        a = array_idx_modifiable(&attachments, array_count(&attachments)-1);
        a->decoded_size = output->offset - a->buffer_offset;
 
-       if (o_stream_nfinish(output) < 0)
+       if (o_stream_finish(output) < 0)
                i_unreached();
        o_stream_destroy(&output);
        return 0;
index 580d7ef2c552ec56e970354427785fc6c5ceaa57..27f80e18813ea0f07649062dd481b7b0b475df6d 100644 (file)
@@ -151,7 +151,7 @@ master_instance_list_write(struct master_instance_list *list,
                str_append_c(str, '\n');
                o_stream_nsend(output, str_data(str), str_len(str));
        }
-       if (o_stream_nfinish(output) < 0) {
+       if (o_stream_finish(output) < 0) {
                i_error("write(%s) failed: %s", path, o_stream_get_error(output));
                ret = -1;
        }
index 3c9d0f285d6ae6ecd9bfc11e11fe259020c43c51..78897eb0185063785bb786f49ed5685c47a958fb 100644 (file)
@@ -82,7 +82,7 @@ void test_program_client_destroy(struct test_client **_client)
        struct test_client *client = *_client;
        *_client = NULL;
 
-       if (o_stream_nfinish(client->out) != 0)
+       if (o_stream_finish(client->out) < 0)
                i_error("output error: %s", o_stream_get_error(client->out));
 
        io_remove(&client->io);
index 36699ab562a37d9f74bcffab367ef2a23c6bf1c3..2ed9bc91a6bb5f1c94361b726a800496f19b6fe8 100644 (file)
@@ -65,7 +65,7 @@ void test_program_client_destroy(struct test_client **_client)
        struct test_client *client = *_client;
        *_client = NULL;
 
-       if (o_stream_nfinish(client->out) != 0)
+       if (o_stream_finish(client->out) < 0)
                i_error("output error: %s", o_stream_get_error(client->out));
 
        io_remove(&client->io);
index 38a8ef1bfddaace4babd1878718e0440cf14b813..323c4e30131154603db122adbf961d0acd8d9355 100644 (file)
@@ -146,7 +146,7 @@ static int cydir_save_flush(struct cydir_save_context *ctx, const char *path)
        struct stat st;
        int ret = 0;
 
-       if (o_stream_nfinish(ctx->ctx.data.output) < 0) {
+       if (o_stream_finish(ctx->ctx.data.output) < 0) {
                mail_storage_set_critical(storage, "write(%s) failed: %s", path,
                        o_stream_get_error(ctx->ctx.data.output));
                ret = -1;
index 08c792723fb07eca3c4194fba0776c5a1a61a115..619a7aba7431532008a8288f2b2eda15ec921544 100644 (file)
@@ -90,6 +90,7 @@ void dbox_save_end(struct dbox_save_context *ctx)
 {
        struct mail_save_data *mdata = &ctx->ctx.data;
        struct ostream *dbox_output = ctx->dbox_output;
+       int ret;
 
        i_assert(mdata->output != NULL);
 
@@ -97,7 +98,15 @@ void dbox_save_end(struct dbox_save_context *ctx)
                if (index_attachment_save_finish(&ctx->ctx) < 0)
                        ctx->failed = TRUE;
        }
-       if (o_stream_nfinish(mdata->output) < 0) {
+       if (mdata->output != dbox_output) {
+               /* e.g. zlib plugin had changed this. make sure we
+                  successfully write the trailer. */
+               ret = o_stream_finish(mdata->output);
+       } else {
+               /* no plugins - flush the output so far */
+               ret = o_stream_nfinish(mdata->output);
+       }
+       if (ret < 0) {
                mail_storage_set_critical(ctx->ctx.transaction->box->storage,
                                          "write(%s) failed: %s",
                                          o_stream_get_name(mdata->output),
@@ -105,7 +114,6 @@ void dbox_save_end(struct dbox_save_context *ctx)
                ctx->failed = TRUE;
        }
        if (mdata->output != dbox_output) {
-               /* e.g. zlib plugin had changed this */
                o_stream_ref(dbox_output);
                o_stream_destroy(&mdata->output);
                mdata->output = dbox_output;
index 6efaa2420957d64b91ef35630bf2368671477e17..1256e12f73d0f3d7d0b6a05ee5e2230f0676b958 100644 (file)
@@ -329,7 +329,7 @@ int sdbox_file_move(struct dbox_file *file, bool alt_path)
        output = o_stream_create_fd_file(out_fd, 0, FALSE);
        i_stream_seek(file->input, 0);
        o_stream_nsend_istream(output, file->input);
-       if (o_stream_nfinish(output) < 0) {
+       if (o_stream_finish(output) < 0) {
                mail_storage_set_critical(storage, "write(%s) failed: %s",
                        temp_path, o_stream_get_error(output));
                ret = -1;
index 4876d0c856af6cd549c0fc2817d34e8f7148c24d..59e8dd66abae5ae2fe22700915832db2beec107a 100644 (file)
@@ -274,7 +274,7 @@ int imapc_save_finish(struct mail_save_context *_ctx)
        ctx->finished = TRUE;
 
        if (!ctx->failed) {
-               if (o_stream_nfinish(_ctx->data.output) < 0) {
+               if (o_stream_finish(_ctx->data.output) < 0) {
                        if (!mail_storage_set_error_from_errno(storage)) {
                                mail_storage_set_critical(storage,
                                        "write(%s) failed: %s", ctx->temp_path,
index 43210208d9a49e3a9cec714d74e5035ec0cef889..0f6e1e341a027bc904b171c011eb0d52ca97703e 100644 (file)
@@ -529,7 +529,7 @@ static int maildir_save_finish_real(struct mail_save_context *_ctx)
        }
 
        path = t_strconcat(ctx->tmpdir, "/", ctx->file_last->tmp_name, NULL);
-       if (!ctx->failed && o_stream_nfinish(_ctx->data.output) < 0) {
+       if (!ctx->failed && o_stream_finish(_ctx->data.output) < 0) {
                if (!mail_storage_set_error_from_errno(storage)) {
                        mail_storage_set_critical(storage,
                                "write(%s) failed: %s", path,
index 533d81888f23c9eb1c191685a760a92e622a407a..5782e217b1586a8afede723e45453dd81b1caa13 100644 (file)
@@ -1310,7 +1310,7 @@ static int maildir_uidlist_write_fd(struct maildir_uidlist *uidlist, int fd,
        }
        maildir_uidlist_iter_deinit(&iter);
 
-       if (o_stream_nfinish(output) < 0) {
+       if (o_stream_finish(output) < 0) {
                mail_storage_set_critical(storage, "write(%s) failed: %s", path,
                                          o_stream_get_error(output));
                o_stream_unref(&output);
index 0634b81464c6302363cdfe8033b930794b430e18..4b3d866cd99e5474ab57453f4417bdbcba75986f 100644 (file)
@@ -231,7 +231,7 @@ int subsfile_set_subscribed(struct mailbox_list *list, const char *path,
        }
 
        if (changed && !failed) {
-               if (o_stream_nfinish(output) < 0) {
+               if (o_stream_finish(output) < 0) {
                        subswrite_set_syscall_error(list, "write()", path);
                        failed = TRUE;
                } else if (mail_set->parsed_fsync_mode != FSYNC_MODE_NEVER) {
index f8229382c3fa45f3c83dfe1f4545eb8c9ba96c71..d4dcb62709d91653da8fc45e23c864acc76a4d09 100644 (file)
@@ -320,7 +320,7 @@ void mail_duplicate_db_flush(struct mail_duplicate_db *db)
        }
        hash_table_iterate_deinit(&iter);
 
-       if (o_stream_nfinish(output) < 0) {
+       if (o_stream_finish(output) < 0) {
                i_error("write(%s) failed: %s", file->path,
                        o_stream_get_error(output));
                o_stream_unref(&output);
index f510f3b2bd0e459fed4046601cbc991acb96151e..1b5656c0a3cf83a27ebf9a4f99dab6dd79848663 100644 (file)
@@ -309,7 +309,7 @@ static void test_istream_multiplex_stream(void)
        i_stream_unref(&chan0);
        i_stream_unref(&is);
 
-       test_assert(o_stream_nfinish(os) == 0);
+       test_assert(o_stream_finish(os) > 0);
        o_stream_unref(&os);
 
        io_loop_destroy(&ioloop);
index a4d3a4cfe099ea7aaf2947d3143236ed7715794f..3a40357d335a3ee7c2114295017924ea1b994fe3 100644 (file)
@@ -106,10 +106,10 @@ static void teardown_channel(struct test_channel *channel)
        io_remove(&channel->io);
        io_remove(&channel->io_alt);
        i_stream_unref(&channel->in);
-       test_assert(o_stream_nfinish(channel->out) == 0);
+       test_assert(o_stream_finish(channel->out) > 0);
        o_stream_unref(&channel->out);
        i_stream_unref(&channel->in_alt);
-       test_assert(o_stream_nfinish(channel->out_alt) == 0);
+       test_assert(o_stream_finish(channel->out_alt) > 0);
        o_stream_unref(&channel->out_alt);
        i_close_fd(&channel->fds[0]);
        i_close_fd(&channel->fds[1]);
index af5253cdd252e661fbff9a6c1908d48471ffd7bb..d3c78821691ebaf0d1ed57d92f8967a7d740f33a 100644 (file)
@@ -39,7 +39,7 @@ static void test_ostream_buffer_random_once(void)
        }
 
        o_stream_uncork(output);
-       test_assert(o_stream_nfinish(output) == 0);
+       test_assert(o_stream_finish(output) > 0);
 
        i_assert(buffer->used <= MAX_BUFSIZE*4);
        test_assert(memcmp(buf, buffer->data, buffer->used) == 0);
index 4383ba4f2a8d11670fc4dd5bd3d7df37dfe606fe..3c6346fb61484cbf3957a12c47012f93daa15f6e 100644 (file)
@@ -46,7 +46,7 @@ static void test_ostream_file_random_once(void)
        }
 
        o_stream_uncork(output);
-       test_assert(o_stream_nfinish(output) == 0);
+       test_assert(o_stream_finish(output) > 0);
        ret = pread(fd, buf2, sizeof(buf2), 0);
        if (ret < 0)
                i_fatal("pread() failed: %m");
index 29cc8bb1697fdd4aa7c240a8cb75453c12b3e828..8b1791dbdc95ad27c49ebe63866514025712edf6 100644 (file)
@@ -125,9 +125,9 @@ static void test_ostream_multiplex_stream(void)
        io_remove(&io0);
        io_remove(&io1);
 
-       test_assert(o_stream_nfinish(chan1) == 0);
+       test_assert(o_stream_finish(chan1) > 0);
        o_stream_unref(&chan1);
-       test_assert(o_stream_nfinish(chan0) == 0);
+       test_assert(o_stream_finish(chan0) > 0);
        o_stream_unref(&chan0);
 
        i_stream_unref(&is);
index 58b761b4456a0c9b2d91d990eddd6eda1364a266..81c06b07cb0b0ef3c0d07a780378581baf3e89ae 100644 (file)
@@ -281,7 +281,7 @@ acl_backend_vfile_acllist_try_rebuild(struct acl_backend_vfile *backend)
                }
        }
 
-       if (o_stream_nfinish(output) < 0) {
+       if (o_stream_finish(output) < 0) {
                i_error("write(%s) failed: %s", str_c(path),
                        o_stream_get_error(output));
                ret = -1;
index d510e0d5fdeedcdfca0a44ee94550e8c0f2e5547..382ab9994a04c608e45645a1afd4a641ed426805 100644 (file)
@@ -158,7 +158,7 @@ acl_backend_vfile_update_write(struct acl_object *aclobj,
                }
        }
        str_free(&str);
-       if (o_stream_nfinish(output) < 0) {
+       if (o_stream_finish(output) < 0) {
                i_error("write(%s) failed: %s", path,
                        o_stream_get_error(output));
                ret = -1;
index 6188021d721942bb134d120a8362249385d78c18..d95f0bb9e4a62d9b13f9d6105d7d7d22587fd0bf 100644 (file)
@@ -1678,7 +1678,7 @@ static int squat_trie_write(struct squat_trie_build_context *ctx)
                (void)o_stream_seek(output, 0);
                o_stream_nsend(output, &trie->hdr, sizeof(trie->hdr));
        }
-       if (o_stream_nfinish(output) < 0) {
+       if (o_stream_finish(output) < 0) {
                i_error("write(%s) failed: %s", path,
                        o_stream_get_error(output));
                ret = -1;
index 5027f705c7f3747b3bc598fdfc0ad6fa57323c52..991677aaf38ab8cc48c9ae4587eba6da87cd7242 100644 (file)
@@ -860,7 +860,7 @@ int squat_uidlist_build_finish(struct squat_uidlist_build_context *ctx)
                (void)o_stream_seek(ctx->output, ctx->build_hdr.used_file_size);
        }
 
-       if (o_stream_nfinish(ctx->output) < 0) {
+       if (o_stream_finish(ctx->output) < 0) {
                i_error("write() to %s failed: %s", ctx->uidlist->path,
                        o_stream_get_error(ctx->output));
                return -1;
@@ -1064,7 +1064,7 @@ int squat_uidlist_rebuild_finish(struct squat_uidlist_rebuild_context *ctx,
 
                if (ctx->uidlist->corrupted)
                        ret = -1;
-               else if (o_stream_nfinish(ctx->output) < 0) {
+               else if (o_stream_finish(ctx->output) < 0) {
                        i_error("write(%s) failed: %s", temp_path,
                                o_stream_get_error(ctx->output));
                        ret = -1;
index c0a1c6e85310bcbc329eeebe67fc867ce4491e09..b7d1ec7adcfaf08e251d87be04a2b2545741b639 100644 (file)
@@ -427,7 +427,7 @@ int replicator_queue_export(struct replicator_queue *queue, const char *path)
                        break;
        }
        replicator_queue_iter_deinit(&iter);
-       if (o_stream_nfinish(output) < 0) {
+       if (o_stream_finish(output) < 0) {
                i_error("write(%s) failed: %s", path, o_stream_get_error(output));
                ret = -1;
        }
index 9b7f1d3a4db975127c93f68d5fcdb13028c22056..8f30089bc148ecab09fc5a01ac1ae54a7aef7c60 100644 (file)
@@ -46,7 +46,7 @@ static void rawlog_proxy_destroy(struct rawlog_proxy *proxy)
 {
        if (proxy->in_output != NULL) {
                o_stream_uncork(proxy->in_output);
-               if (o_stream_nfinish(proxy->in_output) < 0) {
+               if (o_stream_finish(proxy->in_output) < 0) {
                        i_error("write(in) failed: %s",
                                o_stream_get_error(proxy->in_output));
                }
@@ -54,7 +54,7 @@ static void rawlog_proxy_destroy(struct rawlog_proxy *proxy)
        }
        if (proxy->out_output != NULL) {
                o_stream_uncork(proxy->out_output);
-               if (o_stream_nfinish(proxy->out_output) < 0) {
+               if (o_stream_finish(proxy->out_output) < 0) {
                        i_error("write(out) failed: %s",
                                o_stream_get_error(proxy->out_output));
                }