From: Timo Sirainen Date: Fri, 27 Oct 2017 22:55:12 +0000 (+0300) Subject: global: Replace o_stream_nfinish() with o_stream_finish() whenever possible X-Git-Tag: 2.3.0.rc1~707 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad9afb64630511d5e25bc5bc11c5304986156928;p=thirdparty%2Fdovecot%2Fcore.git global: Replace o_stream_nfinish() with o_stream_finish() whenever possible --- diff --git a/src/doveadm/client-connection-http.c b/src/doveadm/client-connection-http.c index 77594d1333..3ad6c5ae7d 100644 --- a/src/doveadm/client-connection-http.c +++ b/src/doveadm/client-connection-http.c @@ -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); diff --git a/src/doveadm/dsync/dsync-ibc-stream.c b/src/doveadm/dsync/dsync-ibc-stream.c index ccd4b42fb0..c48f2f3b60 100644 --- a/src/doveadm/dsync/dsync-ibc-stream.c +++ b/src/doveadm/dsync/dsync-ibc-stream.c @@ -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); diff --git a/src/lib-compression/test-compression.c b/src/lib-compression/test-compression.c index 79fe441e6f..ff1658c7bf 100644 --- a/src/lib-compression/test-compression.c +++ b/src/lib-compression/test-compression.c @@ -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)); } diff --git a/src/lib-dcrypt/test-stream.c b/src/lib-dcrypt/test-stream.c index 243e528394..0c071be911 100644 --- a/src/lib-dcrypt/test-stream.c +++ b/src/lib-dcrypt/test-stream.c @@ -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, "", 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)); diff --git a/src/lib-dict/dict-file.c b/src/lib-dict/dict-file.c index 6c16f1d435..9d37016675 100644 --- a/src/lib-dict/dict-file.c +++ b/src/lib-dict/dict-file.c @@ -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); diff --git a/src/lib-fs/fs-api.c b/src/lib-fs/fs-api.c index bd30e600e2..ab5d6846d3 100644 --- a/src/lib-fs/fs-api.c +++ b/src/lib-fs/fs-api.c @@ -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)); diff --git a/src/lib-index/mail-cache-compress.c b/src/lib-index/mail-cache-compress.c index 6cd6ba1b31..8712bb30bc 100644 --- a/src/lib-index/mail-cache-compress.c +++ b/src/lib-index/mail-cache-compress.c @@ -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); diff --git a/src/lib-index/mail-index-strmap.c b/src/lib-index/mail-index-strmap.c index 63958db554..0b2fc1aae8 100644 --- a/src/lib-index/mail-index-strmap.c +++ b/src/lib-index/mail-index-strmap.c @@ -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; } diff --git a/src/lib-index/mail-index-write.c b/src/lib-index/mail-index-write.c index b01ef80f28..accb456c0d 100644 --- a/src/lib-index/mail-index-write.c +++ b/src/lib-index/mail-index-write.c @@ -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; } diff --git a/src/lib-mail/istream-attachment-extractor.c b/src/lib-mail/istream-attachment-extractor.c index b1b4026e5e..3f59b7e6d0 100644 --- a/src/lib-mail/istream-attachment-extractor.c +++ b/src/lib-mail/istream-attachment-extractor.c @@ -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)); diff --git a/src/lib-mail/test-istream-attachment.c b/src/lib-mail/test-istream-attachment.c index d97bcf5f5b..16529138c7 100644 --- a/src/lib-mail/test-istream-attachment.c +++ b/src/lib-mail/test-istream-attachment.c @@ -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; diff --git a/src/lib-master/master-instance.c b/src/lib-master/master-instance.c index 580d7ef2c5..27f80e1881 100644 --- a/src/lib-master/master-instance.c +++ b/src/lib-master/master-instance.c @@ -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; } diff --git a/src/lib-program-client/test-program-client-net.c b/src/lib-program-client/test-program-client-net.c index 3c9d0f285d..78897eb018 100644 --- a/src/lib-program-client/test-program-client-net.c +++ b/src/lib-program-client/test-program-client-net.c @@ -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); diff --git a/src/lib-program-client/test-program-client-unix.c b/src/lib-program-client/test-program-client-unix.c index 36699ab562..2ed9bc91a6 100644 --- a/src/lib-program-client/test-program-client-unix.c +++ b/src/lib-program-client/test-program-client-unix.c @@ -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); diff --git a/src/lib-storage/index/cydir/cydir-save.c b/src/lib-storage/index/cydir/cydir-save.c index 38a8ef1bfd..323c4e3013 100644 --- a/src/lib-storage/index/cydir/cydir-save.c +++ b/src/lib-storage/index/cydir/cydir-save.c @@ -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; diff --git a/src/lib-storage/index/dbox-common/dbox-save.c b/src/lib-storage/index/dbox-common/dbox-save.c index 08c792723f..619a7aba74 100644 --- a/src/lib-storage/index/dbox-common/dbox-save.c +++ b/src/lib-storage/index/dbox-common/dbox-save.c @@ -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; diff --git a/src/lib-storage/index/dbox-single/sdbox-file.c b/src/lib-storage/index/dbox-single/sdbox-file.c index 6efaa24209..1256e12f73 100644 --- a/src/lib-storage/index/dbox-single/sdbox-file.c +++ b/src/lib-storage/index/dbox-single/sdbox-file.c @@ -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; diff --git a/src/lib-storage/index/imapc/imapc-save.c b/src/lib-storage/index/imapc/imapc-save.c index 4876d0c856..59e8dd66ab 100644 --- a/src/lib-storage/index/imapc/imapc-save.c +++ b/src/lib-storage/index/imapc/imapc-save.c @@ -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, diff --git a/src/lib-storage/index/maildir/maildir-save.c b/src/lib-storage/index/maildir/maildir-save.c index 43210208d9..0f6e1e341a 100644 --- a/src/lib-storage/index/maildir/maildir-save.c +++ b/src/lib-storage/index/maildir/maildir-save.c @@ -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, diff --git a/src/lib-storage/index/maildir/maildir-uidlist.c b/src/lib-storage/index/maildir/maildir-uidlist.c index 533d81888f..5782e217b1 100644 --- a/src/lib-storage/index/maildir/maildir-uidlist.c +++ b/src/lib-storage/index/maildir/maildir-uidlist.c @@ -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); diff --git a/src/lib-storage/list/subscription-file.c b/src/lib-storage/list/subscription-file.c index 0634b81464..4b3d866cd9 100644 --- a/src/lib-storage/list/subscription-file.c +++ b/src/lib-storage/list/subscription-file.c @@ -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) { diff --git a/src/lib-storage/mail-duplicate.c b/src/lib-storage/mail-duplicate.c index f8229382c3..d4dcb62709 100644 --- a/src/lib-storage/mail-duplicate.c +++ b/src/lib-storage/mail-duplicate.c @@ -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); diff --git a/src/lib/test-istream-multiplex.c b/src/lib/test-istream-multiplex.c index f510f3b2bd..1b5656c0a3 100644 --- a/src/lib/test-istream-multiplex.c +++ b/src/lib/test-istream-multiplex.c @@ -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); diff --git a/src/lib/test-multiplex.c b/src/lib/test-multiplex.c index a4d3a4cfe0..3a40357d33 100644 --- a/src/lib/test-multiplex.c +++ b/src/lib/test-multiplex.c @@ -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]); diff --git a/src/lib/test-ostream-buffer.c b/src/lib/test-ostream-buffer.c index af5253cdd2..d3c7882169 100644 --- a/src/lib/test-ostream-buffer.c +++ b/src/lib/test-ostream-buffer.c @@ -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); diff --git a/src/lib/test-ostream-file.c b/src/lib/test-ostream-file.c index 4383ba4f2a..3c6346fb61 100644 --- a/src/lib/test-ostream-file.c +++ b/src/lib/test-ostream-file.c @@ -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"); diff --git a/src/lib/test-ostream-multiplex.c b/src/lib/test-ostream-multiplex.c index 29cc8bb169..8b1791dbdc 100644 --- a/src/lib/test-ostream-multiplex.c +++ b/src/lib/test-ostream-multiplex.c @@ -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); diff --git a/src/plugins/acl/acl-backend-vfile-acllist.c b/src/plugins/acl/acl-backend-vfile-acllist.c index 58b761b445..81c06b07cb 100644 --- a/src/plugins/acl/acl-backend-vfile-acllist.c +++ b/src/plugins/acl/acl-backend-vfile-acllist.c @@ -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; diff --git a/src/plugins/acl/acl-backend-vfile-update.c b/src/plugins/acl/acl-backend-vfile-update.c index d510e0d5fd..382ab9994a 100644 --- a/src/plugins/acl/acl-backend-vfile-update.c +++ b/src/plugins/acl/acl-backend-vfile-update.c @@ -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; diff --git a/src/plugins/fts-squat/squat-trie.c b/src/plugins/fts-squat/squat-trie.c index 6188021d72..d95f0bb9e4 100644 --- a/src/plugins/fts-squat/squat-trie.c +++ b/src/plugins/fts-squat/squat-trie.c @@ -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; diff --git a/src/plugins/fts-squat/squat-uidlist.c b/src/plugins/fts-squat/squat-uidlist.c index 5027f705c7..991677aaf3 100644 --- a/src/plugins/fts-squat/squat-uidlist.c +++ b/src/plugins/fts-squat/squat-uidlist.c @@ -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; diff --git a/src/replication/replicator/replicator-queue.c b/src/replication/replicator/replicator-queue.c index c0a1c6e853..b7d1ec7adc 100644 --- a/src/replication/replicator/replicator-queue.c +++ b/src/replication/replicator/replicator-queue.c @@ -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; } diff --git a/src/util/rawlog.c b/src/util/rawlog.c index 9b7f1d3a4d..8f30089bc1 100644 --- a/src/util/rawlog.c +++ b/src/util/rawlog.c @@ -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)); }