typedef bool auth_worker_callback_t(const char *reply, void *context);
-struct auth_worker_connection *
+struct auth_worker_connection * ATTR_NOWARN_UNUSED_RESULT
auth_worker_call(pool_t pool, struct auth_stream_reply *data,
auth_worker_callback_t *callback, void *context);
void auth_worker_server_resume_input(struct auth_worker_connection *conn);
auth_request_export(request, reply);
auth_request_ref(request);
- (void)auth_worker_call(request->pool, reply,
- verify_plain_callback, request);
+ auth_worker_call(request->pool, reply, verify_plain_callback, request);
}
static bool lookup_credentials_callback(const char *reply, void *context)
auth_request_export(request, reply);
auth_request_ref(request);
- (void)auth_worker_call(request->pool, reply,
- lookup_credentials_callback, request);
+ auth_worker_call(request->pool, reply,
+ lookup_credentials_callback, request);
}
static bool
auth_request_export(request, reply);
auth_request_ref(request);
- (void)auth_worker_call(request->pool, reply,
- set_credentials_callback, request);
+ auth_worker_call(request->pool, reply,
+ set_credentials_callback, request);
}
auth_request_export(request, reply);
auth_request_ref(request);
- (void)auth_worker_call(request->pool, reply, user_callback, request);
+ auth_worker_call(request->pool, reply, user_callback, request);
}
static bool iter_callback(const char *reply, void *context)
if (ctx->delete_empty_mailbox && ret == 0) {
if (mailbox_delete_empty(box) < 0) {
- (void)mailbox_get_last_error(box, &error);
+ error = mailbox_get_last_mail_error(box);
if (error != MAIL_ERROR_EXISTS) {
doveadm_mail_failed_mailbox(_ctx, box);
ret = -1;
{
enum mail_error error;
- (void)mail_storage_get_last_error(storage, &error);
+ mail_storage_get_last_error(storage, &error);
doveadm_mail_failed_error(ctx, error);
}
deletes = dsync_mailbox_tree_get_deletes(brain->local_mailbox_tree,
&count);
- (void)dsync_slave_send_mailbox_deletes(brain->slave, deletes, count,
- brain->hierarchy_sep);
+ dsync_slave_send_mailbox_deletes(brain->slave, deletes, count,
+ brain->hierarchy_sep);
brain->state = DSYNC_STATE_RECV_MAILBOX_TREE;
}
}
/* start exporting this mailbox (wait for remote to start importing) */
- (void)dsync_slave_send_mailbox(brain->slave, &dsync_box);
+ dsync_slave_send_mailbox(brain->slave, &dsync_box);
(void)dsync_brain_sync_mailbox_init(brain, box, &dsync_box,
DSYNC_BOX_STATE_MAILBOX);
brain->state = DSYNC_STATE_SYNC_MAILS;
memcpy(delete_box.mailbox_guid, dsync_box->mailbox_guid,
sizeof(delete_box.mailbox_guid));
delete_box.mailbox_lost = TRUE;
- (void)dsync_slave_send_mailbox(brain->slave, &delete_box);
+ dsync_slave_send_mailbox(brain->slave, &delete_box);
return TRUE;
}
i_assert(local_dsync_box.uid_validity != 0);
i_assert(memcmp(dsync_box->mailbox_guid, local_dsync_box.mailbox_guid,
sizeof(dsync_box->mailbox_guid)) == 0);
- (void)dsync_slave_send_mailbox(brain->slave, &local_dsync_box);
+ dsync_slave_send_mailbox(brain->slave, &local_dsync_box);
dsync_brain_mailbox_update_pre(brain, box, &local_dsync_box, dsync_box);
if (changes_during_sync)
brain->changes_during_sync = TRUE;
}
- (void)dsync_slave_send_mailbox_state(brain->slave, &state);
+ dsync_slave_send_mailbox_state(brain->slave, &state);
}
static bool dsync_brain_recv_mail(struct dsync_brain *brain)
return ret;
}
-static struct item *
+static struct item * ATTR_NOWARN_UNUSED_RESULT
dsync_slave_pipe_push_item(struct dsync_slave_pipe *pipe, enum item_type type)
{
struct item *item;
{
struct dsync_slave_pipe *pipe = (struct dsync_slave_pipe *)slave;
- (void)dsync_slave_pipe_push_item(pipe->remote, ITEM_END_OF_LIST);
+ dsync_slave_pipe_push_item(pipe->remote, ITEM_END_OF_LIST);
}
static void
DSYNC_SLAVE_SEND_RET_OK;
}
-void dsync_slave_send_end_of_list(struct dsync_slave *slave)
+enum dsync_slave_send_ret
+dsync_slave_send_end_of_list(struct dsync_slave *slave)
{
slave->v.send_end_of_list(slave);
+ return dsync_slave_send_ret(slave);
}
enum dsync_slave_send_ret
dsync_slave_recv_handshake(struct dsync_slave *slave,
const struct dsync_slave_settings **set_r);
-void dsync_slave_send_end_of_list(struct dsync_slave *slave);
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
+dsync_slave_send_end_of_list(struct dsync_slave *slave);
-enum dsync_slave_send_ret
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
dsync_slave_send_mailbox_state(struct dsync_slave *slave,
const struct dsync_mailbox_state *state);
enum dsync_slave_recv_ret
dsync_slave_recv_mailbox_state(struct dsync_slave *slave,
struct dsync_mailbox_state *state_r);
-enum dsync_slave_send_ret
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
dsync_slave_send_mailbox_tree_node(struct dsync_slave *slave,
const char *const *name,
const struct dsync_mailbox_node *node);
const char *const **name_r,
const struct dsync_mailbox_node **node_r);
-enum dsync_slave_send_ret
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
dsync_slave_send_mailbox_deletes(struct dsync_slave *slave,
const struct dsync_mailbox_delete *deletes,
unsigned int count, char hierarchy_sep);
const struct dsync_mailbox_delete **deletes_r,
unsigned int *count_r, char *hierarchy_sep_r);
-enum dsync_slave_send_ret
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
dsync_slave_send_mailbox(struct dsync_slave *slave,
const struct dsync_mailbox *dsync_box);
enum dsync_slave_recv_ret
dsync_slave_recv_mailbox(struct dsync_slave *slave,
const struct dsync_mailbox **dsync_box_r);
-enum dsync_slave_send_ret
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
dsync_slave_send_change(struct dsync_slave *slave,
const struct dsync_mail_change *change);
enum dsync_slave_recv_ret
dsync_slave_recv_change(struct dsync_slave *slave,
const struct dsync_mail_change **change_r);
-enum dsync_slave_send_ret
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
dsync_slave_send_mail_request(struct dsync_slave *slave,
const struct dsync_mail_request *request);
enum dsync_slave_recv_ret
dsync_slave_recv_mail_request(struct dsync_slave *slave,
const struct dsync_mail_request **request_r);
-enum dsync_slave_send_ret
+enum dsync_slave_send_ret ATTR_NOWARN_UNUSED_RESULT
dsync_slave_send_mail(struct dsync_slave *slave,
const struct dsync_mail *mail);
enum dsync_slave_recv_ret
bool returned_all_changes;
};
-static bool
+static bool ATTR_NOWARN_UNUSED_RESULT
export_change_get(struct dsync_transaction_log_scan *ctx, uint32_t uid,
enum dsync_mail_change_type type,
struct dsync_mail_change **change_r)
end = CONST_PTR_OFFSET(data, hdr->size);
for (; rec != end; rec++) {
for (uid = rec->uid1; uid <= rec->uid2; uid++) {
- (void)export_change_get(ctx, uid,
- DSYNC_MAIL_CHANGE_TYPE_EXPUNGE,
- &change);
+ export_change_get(ctx, uid,
+ DSYNC_MAIL_CHANGE_TYPE_EXPUNGE,
+ &change);
}
}
}
end = CONST_PTR_OFFSET(data, hdr->size);
for (; rec != end; rec++) {
if (uid >= rec->uid1 && uid <= rec->uid2) {
- (void)export_change_get(ctx, uid,
- DSYNC_MAIL_CHANGE_TYPE_EXPUNGE,
- &change);
+ export_change_get(ctx, uid,
+ DSYNC_MAIL_CHANGE_TYPE_EXPUNGE,
+ &change);
return TRUE;
}
}
}
}
o_stream_uncork(imap_client->common.output);
- (void)client_unref(&client);
+ client_unref(&client);
}
static struct client *imap_client_alloc(pool_t pool)
(void)client_handle_unfinished_cmd(cmd);
else
client_command_free(&cmd);
- (void)cmd_sync_delayed(client);
+ cmd_sync_delayed(client);
o_stream_uncork(client->output);
if (client->disconnected)
return FALSE;
if (client->input_lock == NULL)
- (void)cmd_sync_delayed(client);
+ cmd_sync_delayed(client);
return TRUE;
}
}
}
- (void)cmd_sync_delayed(client);
+ cmd_sync_delayed(client);
o_stream_uncork(client->output);
if (client->disconnected)
client_destroy(client, NULL);
/* Sets the hook_client_created and returns the previous hook,
which the new_hook should call if it's non-NULL. */
-imap_client_created_func_t *
+imap_client_created_func_t * ATTR_NOWARN_UNUSED_RESULT
imap_client_created_hook_set(imap_client_created_func_t *new_hook);
void imap_refresh_proctitle(void);
(void)client_handle_unfinished_cmd(cmd);
else
client_command_free(&cmd);
- (void)cmd_sync_delayed(client);
+ cmd_sync_delayed(client);
if (client->disconnected)
client_destroy(client, NULL);
}
client_command_free(&sync_cmd);
- (void)cmd_sync_delayed(client);
+ cmd_sync_delayed(client);
return TRUE;
}
enum mailbox_sync_flags flags,
enum imap_sync_flags imap_flags,
imap_sync_callback_t *callback);
-bool cmd_sync_delayed(struct client *client);
+bool cmd_sync_delayed(struct client *client) ATTR_NOWARN_UNUSED_RESULT;
#endif
return ctx->failed ? -1 : 0;
}
-static int
+static int ATTR_NOWARN_UNUSED_RESULT
client_dict_send_transaction_query(struct client_dict_transaction_context *ctx,
const char *query)
{
query = t_strdup_printf("%c%u\n", DICT_PROTOCOL_CMD_ROLLBACK,
ctx->id);
- (void)client_dict_send_transaction_query(ctx, query);
+ client_dict_send_transaction_query(ctx, query);
} T_END;
DLLIST_REMOVE(&dict->transactions, ctx);
DICT_PROTOCOL_CMD_SET, ctx->id,
dict_client_escape(key),
dict_client_escape(value));
- (void)client_dict_send_transaction_query(ctx, query);
+ client_dict_send_transaction_query(ctx, query);
} T_END;
}
query = t_strdup_printf("%c%u\t%s\n",
DICT_PROTOCOL_CMD_UNSET, ctx->id,
dict_client_escape(key));
- (void)client_dict_send_transaction_query(ctx, query);
+ client_dict_send_transaction_query(ctx, query);
} T_END;
}
query = t_strdup_printf("%c%u\t%s\t%lld\n",
DICT_PROTOCOL_CMD_ATOMIC_INC,
ctx->id, dict_client_escape(key), diff);
- (void)client_dict_send_transaction_query(ctx, query);
+ client_dict_send_transaction_query(ctx, query);
} T_END;
}
/* refresh once more now that we're locked */
if (file_dict_refresh(dict) < 0) {
if (dotlock != NULL)
- (void)file_dotlock_delete(&dotlock);
+ file_dotlock_delete(&dotlock);
else {
i_close_fd(fd);
file_unlock(&lock);
if (*conn->client->set.rawlog_dir != '\0' &&
stat(conn->client->set.rawlog_dir, &st) == 0) {
- (void)iostream_rawlog_create(conn->client->set.rawlog_dir,
- &conn->input, &conn->output);
+ iostream_rawlog_create(conn->client->set.rawlog_dir,
+ &conn->input, &conn->output);
}
imap_parser_set_streams(conn->parser, conn->input, NULL);
if (*conn->client->set.rawlog_dir != '\0' &&
conn->client->set.ssl_mode != IMAPC_CLIENT_SSL_MODE_IMMEDIATE &&
stat(conn->client->set.rawlog_dir, &st) == 0) {
- (void)iostream_rawlog_create(conn->client->set.rawlog_dir,
- &conn->input, &conn->output);
+ iostream_rawlog_create(conn->client->set.rawlog_dir,
+ &conn->input, &conn->output);
}
o_stream_set_flush_callback(conn->output, imapc_connection_output,
/* parse parameters and save them */
str_truncate(str, 0);
- (void)rfc2231_parse(&parser, &results);
+ rfc2231_parse(&parser, &results);
for (; *results != NULL; results += 2) {
if (strcasecmp(results[0], "charset") == 0)
charset_found = TRUE;
/* parse parameters and save them */
str_truncate(str, 0);
- (void)rfc2231_parse(&parser, &results);
+ rfc2231_parse(&parser, &results);
for (; *results != NULL; results += 2) {
str_append_c(str, ' ');
imap_quote_append_string(str, results[0], TRUE);
see if it's because the strmap is corrupted or because
our current view is a bit stale and the message has already
been expunged. */
- (void)mail_index_refresh(ctx->view->view->index);
+ mail_index_refresh(ctx->view->view->index);
if (mail_index_is_expunged(ctx->view->view,
ctx->uid_lookup_idx + 1))
ctx->lost_expunged_uid = rec->uid;
uint32_t uid, latest_seq;
if (t->latest_view == NULL) {
- (void)mail_index_refresh(t->view->index);
+ mail_index_refresh(t->view->index);
t->latest_view = mail_index_view_open(t->view->index);
}
mail_index_lookup_uid(t->view, seq, &uid);
expunge handlers get run for the newly expunged messages
(and sync handlers that require HANDLER_FILE as well). */
index->sync_commit_result = result_r;
- (void)mail_index_refresh(index);
+ mail_index_refresh(index);
index->sync_commit_result = NULL;
}
/* Refresh index so mail_index_lookup*() will return latest values. Note that
immediately after this call there may already be changes, so if you need to
rely on validity of the returned values, use some external locking for it. */
-int mail_index_refresh(struct mail_index *index);
+int ATTR_NOWARN_UNUSED_RESULT
+mail_index_refresh(struct mail_index *index);
/* View can be used to look into index. Sequence numbers inside view change
only when you synchronize it. The view acquires required locks
if (--file->log->dotlock_count > 0)
return 0;
- ret = file_dotlock_delete_verified(&file->log->dotlock);
+ ret = file_dotlock_delete(&file->log->dotlock);
if (ret < 0) {
log_file_set_syscall_error(file, "file_dotlock_delete()");
return -1;
struct istream_private *stream = &bstream->istream;
size_t old_size, avail_size;
- (void)i_stream_get_buffer_space(stream, size, &avail_size);
+ i_stream_get_buffer_space(stream, size, &avail_size);
if (avail_size < size) {
old_size = stream->buffer_size;
stream->buffer_size = nearest_power(stream->pos + size);
stream->w_buffer = i_realloc(stream->w_buffer, old_size,
stream->buffer_size);
stream->buffer = stream->w_buffer;
- (void)i_stream_get_buffer_space(stream, size, &avail_size);
+ i_stream_get_buffer_space(stream, size, &avail_size);
i_assert(avail_size >= size);
}
return stream->w_buffer + stream->pos;
if (rfc822_parse_content_type(&parser, str) <= 0)
return;
- (void)rfc2231_parse(&parser, &results);
+ rfc2231_parse(&parser, &results);
for (; *results != NULL; results += 2) {
if (strcasecmp(results[0], "charset") == 0) {
ctx->content_charset = i_strdup(results[1]);
ctx->last_boundary != NULL)
return;
- (void)rfc2231_parse(&parser, &results);
+ rfc2231_parse(&parser, &results);
for (; *results != NULL; results += 2) {
if (strcasecmp(results[0], "boundary") == 0) {
ctx->last_boundary =
them as a NULL-terminated [key, value] array. RFC 2231-style continuations
are merged to a single key. Returns -1 if some of the input was invalid
(but valid key/value pairs are still returned), 0 if everything looked ok. */
-int rfc2231_parse(struct rfc822_parser_context *ctx,
- const char *const **result_r);
+int ATTR_NOWARN_UNUSED_RESULT
+rfc2231_parse(struct rfc822_parser_context *ctx,
+ const char *const **result_r);
#endif
struct mail *_mail = &mail->imail.mail.mail;
struct mdbox_mailbox *mbox = (struct mdbox_mailbox *)_mail->box;
- (void)mail_index_refresh(_mail->box->index);
+ mail_index_refresh(_mail->box->index);
if (mail_index_is_expunged(_mail->transaction->view, _mail->seq)) {
mail_set_expunged(_mail);
return;
{
struct mail *_mail = &mail->imail.mail.mail;
- (void)mail_index_refresh(_mail->box->index);
+ mail_index_refresh(_mail->box->index);
if (mail_index_is_expunged(_mail->transaction->view, _mail->seq)) {
mail_set_expunged(_mail);
return;
mail_index_view_close(&view);
if (ret < 0 && retry) {
- (void)mail_index_refresh(mbox->box.index);
+ mail_index_refresh(mbox->box.index);
return sdbox_refresh_header(mbox, FALSE, log_error);
}
return ret;
index_storage_mailbox_update_cache(box, update);
/* make sure we get the latest index info */
- (void)mail_index_refresh(box->index);
+ mail_index_refresh(box->index);
view = mail_index_view_open(box->index);
hdr = mail_index_get_header(view);
if (mailbox_list_delete_dir(box->list, box->name) == 0)
return 0;
- (void)mailbox_list_get_last_error(box->list, &error);
+ mailbox_list_get_last_error(box->list, &error);
if (error != MAIL_ERROR_NOTFOUND || !mailbox_deleted) {
mail_storage_copy_list_error(box->storage, box->list);
return -1;
{
struct mailbox_metadata metadata;
struct mailbox_status status;
- enum mail_error error;
int ret_guid;
if (!box->opened) {
metadata.guid);
}
if (index_storage_mailbox_delete_dir(box, TRUE) < 0) {
- (void)mailbox_get_last_error(box, &error);
- if (error != MAIL_ERROR_EXISTS)
+ if (mailbox_get_last_mail_error(box) != MAIL_ERROR_EXISTS)
return -1;
/* we deleted the mailbox, but couldn't delete the directory
because it has children. that's not an error. */
uids = array_get(&removed_uids, &uid_count);
for (i = j = 0; i < uid_count; i++) {
/* find and remove from the map */
- (void)bsearch_insert_pos(&uids[i].seq1, &msgid_map[j],
- map_count - j, sizeof(*msgid_map),
- msgid_map_cmp, &idx);
+ bsearch_insert_pos(&uids[i].seq1, &msgid_map[j],
+ map_count - j, sizeof(*msgid_map),
+ msgid_map_cmp, &idx);
j += idx;
if (j == map_count) {
/* all removals after this are about messages we never
itrans_flags = index_transaction_flags_get(flags);
if ((flags & MAILBOX_TRANSACTION_FLAG_REFRESH) != 0)
- (void)mail_index_refresh(box->index);
+ mail_index_refresh(box->index);
t->box = box;
t->itrans = mail_index_transaction_begin(box->view, itrans_flags);
/* one reason this could happen is if we delayed opening
dovecot-uidlist and we're trying to open a mail that got recently
expunged. Let's test this theory first: */
- (void)mail_index_refresh(mbox->box.index);
+ mail_index_refresh(mbox->box.index);
view = mail_index_view_open(mbox->box.index);
exists = mail_index_lookup_seq(view, mail->uid, &seq);
mail_index_view_close(&view);
if (mbox->synced) {
/* refresh index only after the first sync, i.e. avoid wasting
time on refreshing it immediately after it was just opened */
- (void)mail_index_refresh(mbox->box.index);
+ mail_index_refresh(mbox->box.index);
}
return mail_index_sync_have_any(mbox->box.index, flags) ? 1 : 0;
}
struct mail_index_view_sync_ctx *sync_ctx;
bool delayed_expunges;
- (void)mail_index_refresh(mbox->box.index);
+ mail_index_refresh(mbox->box.index);
if (mbox->flags_view == NULL)
mbox->flags_view = mail_index_view_open(mbox->box.index);
if (!uidlist->box->opened)
return;
- (void)mail_index_refresh(uidlist->box->index);
+ mail_index_refresh(uidlist->box->index);
view = mail_index_view_open(uidlist->box->index);
count = array_count(&uidlist->records);
hdr = mail_index_get_header(view);
{ 0, NULL, NULL }
};
-static int mbox_lock_list(struct mbox_lock_context *ctx, int lock_type,
- time_t max_wait_time, int idx);
-static int mbox_unlock_files(struct mbox_lock_context *ctx);
+static int ATTR_NOWARN_UNUSED_RESULT
+mbox_lock_list(struct mbox_lock_context *ctx, int lock_type,
+ time_t max_wait_time, int idx);
+static int ATTR_NOWARN_UNUSED_RESULT
+mbox_unlock_files(struct mbox_lock_context *ctx);
static void mbox_read_lock_methods(const char *str, const char *env,
enum mbox_lock_type *locks)
ctx->dotlock_last_stale = TRUE;
return FALSE;
}
- (void)mbox_lock_list(ctx, F_UNLCK, 0, i);
+ mbox_lock_list(ctx, F_UNLCK, 0, i);
}
}
ctx->dotlock_last_stale = stale;
return TRUE;
}
-static int ATTR_NULL(2)
+static int ATTR_NULL(2) ATTR_NOWARN_UNUSED_RESULT
mbox_dotlock_privileged_op(struct mbox_mailbox *mbox,
struct dotlock_settings *set,
enum mbox_dotlock_op op)
break;
case MBOX_DOTLOCK_OP_UNLOCK:
/* we're now privileged - avoid doing as much as possible */
- ret = file_dotlock_delete_verified(&mbox->mbox_dotlock);
+ ret = file_dotlock_delete(&mbox->mbox_dotlock);
if (ret < 0)
mbox_set_syscall_error(mbox, "file_dotlock_delete()");
mbox->mbox_used_privileges = FALSE;
return 1;
if (!mbox->mbox_used_privileges) {
- if (file_dotlock_delete_verified(&mbox->mbox_dotlock) <= 0) {
+ if (file_dotlock_delete(&mbox->mbox_dotlock) <= 0) {
mbox_set_syscall_error(mbox,
"file_dotlock_delete()");
}
} else {
ctx->using_privileges = TRUE;
- (void)mbox_dotlock_privileged_op(mbox, NULL,
- MBOX_DOTLOCK_OP_UNLOCK);
+ mbox_dotlock_privileged_op(mbox, NULL,
+ MBOX_DOTLOCK_OP_UNLOCK);
ctx->using_privileges = FALSE;
}
mbox->mbox_dotlocked = FALSE;
return 1;
}
-static int mbox_lock_list(struct mbox_lock_context *ctx, int lock_type,
- time_t max_wait_time, int idx)
+static int ATTR_NOWARN_UNUSED_RESULT
+mbox_lock_list(struct mbox_lock_context *ctx, int lock_type,
+ time_t max_wait_time, int idx)
{
enum mbox_lock_type *lock_types;
enum mbox_lock_type type;
ret = mbox_lock_list(&ctx, lock_type, max_wait_time, 0);
if (ret <= 0) {
if (!drop_locks)
- (void)mbox_unlock_files(&ctx);
+ mbox_unlock_files(&ctx);
if (ret == 0) {
mail_storage_set_error(&mbox->storage->storage,
MAIL_ERROR_TEMP, MAIL_ERRSTR_LOCK_TIMEOUT);
ctx.lock_status[read_locks[i]] = 0;
mbox->mbox_lock_type = F_WRLCK;
- (void)mbox_lock_list(&ctx, F_UNLCK, 0, 0);
+ mbox_lock_list(&ctx, F_UNLCK, 0, 0);
mbox->mbox_lock_type = F_RDLCK;
}
if (!mbox->mbox_used_privileges)
(void)file_dotlock_touch(mbox->mbox_dotlock);
else {
- (void)mbox_dotlock_privileged_op(mbox, NULL,
+ mbox_dotlock_privileged_op(mbox, NULL,
MBOX_DOTLOCK_OP_TOUCH);
}
}
been overwritten (ie. inode has changed), it's reopened. */
int mbox_lock(struct mbox_mailbox *mbox, int lock_type,
unsigned int *lock_id_r);
-int mbox_unlock(struct mbox_mailbox *mbox, unsigned int lock_id);
+int ATTR_NOWARN_UNUSED_RESULT
+mbox_unlock(struct mbox_mailbox *mbox, unsigned int lock_id);
void mbox_dotlock_touch(struct mbox_mailbox *mbox);
if (mbox->mbox_lock_type == F_RDLCK) {
if (mbox->mbox_lock_id == t->mbox_lock_id)
t->mbox_lock_id = 0;
- (void)mbox_unlock(mbox, mbox->mbox_lock_id);
+ mbox_unlock(mbox, mbox->mbox_lock_id);
i_assert(mbox->mbox_lock_type == F_UNLCK);
}
}
/* open a new view to get the header. this is required if we just
synced the mailbox so we can get updated next_uid. */
- (void)mail_index_refresh(mbox->box.index);
+ mail_index_refresh(mbox->box.index);
view = mail_index_view_open(mbox->box.index);
hdr = mail_index_get_header(view);
(void)mbox_sync(mbox, sync_flags);
if (mbox->mbox_global_lock_id != 0)
- (void)mbox_unlock(mbox, mbox->mbox_global_lock_id);
+ mbox_unlock(mbox, mbox->mbox_global_lock_id);
if (mbox->keep_lock_to != NULL)
timeout_remove(&mbox->keep_lock_to);
struct mbox_mailbox *mbox = (struct mbox_mailbox *)box;
if (lock_id != 0)
- (void)mbox_unlock(mbox, lock_id);
+ mbox_unlock(mbox, lock_id);
if (mbox->mbox_global_lock_id == 0) {
i_assert(mbox->box.transaction_count > 0 ||
mbox->mbox_lock_type == F_UNLCK);
mbox_sync_index_update_ext_header(mbox, trans);
ret = mail_index_transaction_commit(&trans);
}
- (void)mbox_unlock(mbox, lock_id);
+ mbox_unlock(mbox, lock_id);
return ret;
}
return 0;
/* have to sync to make sure offsets have stayed the same */
- (void)mbox_unlock(mbox, *lock_id);
+ mbox_unlock(mbox, *lock_id);
*lock_id = 0;
}
if (lock_id != 0) {
if (ret < 0) {
/* syncing failed, don't leave it locked */
- (void)mbox_unlock(mbox, lock_id);
+ mbox_unlock(mbox, lock_id);
} else if ((flags & MBOX_SYNC_LOCK_READING) == 0) {
if (mbox_unlock(mbox, lock_id) < 0)
ret = -1;
if (*client->set.rawlog_dir != '\0' &&
stat(client->set.rawlog_dir, &st) == 0) {
- (void)iostream_rawlog_create(client->set.rawlog_dir,
- &client->input, &client->output);
+ iostream_rawlog_create(client->set.rawlog_dir,
+ &client->input, &client->output);
}
return 0;
}
if (*client->set.rawlog_dir != '\0' &&
client->set.ssl_mode != POP3C_CLIENT_SSL_MODE_IMMEDIATE &&
stat(client->set.rawlog_dir, &st) == 0) {
- (void)iostream_rawlog_create(client->set.rawlog_dir,
- &client->input, &client->output);
+ iostream_rawlog_create(client->set.rawlog_dir,
+ &client->input, &client->output);
}
client->io = io_add(client->fd, IO_WRITE,
pop3c_client_connected, client);
o_stream_destroy(&output);
if (failed || !changed) {
- if (file_dotlock_delete_verified(&dotlock) < 0) {
+ if (file_dotlock_delete(&dotlock) < 0) {
subswrite_set_syscall_error(list,
"file_dotlock_delete()", path);
failed = TRUE;
{
enum mail_error error;
- (void)mail_storage_get_last_error(box->storage, &error);
+ mail_storage_get_last_error(box->storage, &error);
return error;
}
int mail_storage_purge(struct mail_storage *storage);
/* Returns the error message of last occurred error. */
-const char *mail_storage_get_last_error(struct mail_storage *storage,
- enum mail_error *error_r) ATTR_NULL(2);
+const char * ATTR_NOWARN_UNUSED_RESULT
+mail_storage_get_last_error(struct mail_storage *storage,
+ enum mail_error *error_r) ATTR_NULL(2);
/* Wrapper for mail_storage_get_last_error(); */
-const char *mailbox_get_last_error(struct mailbox *box,
- enum mail_error *error_r) ATTR_NULL(2);
+const char * ATTR_NOWARN_UNUSED_RESULT
+mailbox_get_last_error(struct mailbox *box, enum mail_error *error_r)
+ ATTR_NULL(2);
/* Wrapper for mail_storage_get_last_error(); */
enum mail_error mailbox_get_last_mail_error(struct mailbox *box);
int mailbox_list_delete_symlink(struct mailbox_list *list, const char *name);
/* Returns the error message of last occurred error. */
-const char *mailbox_list_get_last_error(struct mailbox_list *list,
- enum mail_error *error_r);
+const char * ATTR_NOWARN_UNUSED_RESULT
+mailbox_list_get_last_error(struct mailbox_list *list,
+ enum mail_error *error_r);
#endif
tstream->istream.istream.blocking = FALSE;
tstream->istream.istream.seekable = TRUE;
- (void)i_stream_create(&tstream->istream, NULL, -1);
+ i_stream_create(&tstream->istream, NULL, -1);
tstream->istream.statbuf.st_size = tstream->max_pos = size;
tstream->allow_eof = TRUE;
tstream->istream.max_buffer_size = (size_t)-1;
/* If key is found, returns TRUE and sets idx_r to the position where the key
was found. If key isn't found, returns FALSE and sets idx_r to the position
where the key should be inserted. */
-bool bsearch_insert_pos(const void *key, const void *base, unsigned int nmemb,
+bool ATTR_NOWARN_UNUSED_RESULT
+bsearch_insert_pos(const void *key, const void *base, unsigned int nmemb,
size_t size, int (*cmp)(const void *, const void *),
unsigned int *idx_r);
-bool array_bsearch_insert_pos_i(const struct array *array, const void *key,
- int (*cmp)(const void *, const void *),
- unsigned int *idx_r);
+bool ATTR_NOWARN_UNUSED_RESULT
+array_bsearch_insert_pos_i(const struct array *array, const void *key,
+ int (*cmp)(const void *, const void *),
+ unsigned int *idx_r);
#ifdef CONTEXT_TYPE_SAFETY
#define array_bsearch_insert_pos(array, key, cmp, idx_r) \
({(void)(1 ? 0 : cmp(key, ARRAY_TYPE_CAST_CONST(array)NULL)); \
return diff > FILE_DOTLOCK_MAX_STAT_MTIME_DIFF;
}
-void file_dotlock_delete(struct dotlock **dotlock_p)
-{
- (void)file_dotlock_delete_verified(dotlock_p);
-}
-
-int file_dotlock_delete_verified(struct dotlock **dotlock_p)
+int file_dotlock_delete(struct dotlock **dotlock_p)
{
struct dotlock *dotlock;
const char *lock_path;
enum dotlock_create_flags flags,
struct dotlock **dotlock_r);
-/* Delete the dotlock file, ignoring any potential errors. */
-void file_dotlock_delete(struct dotlock **dotlock);
/* Delete the dotlock file. Returns 1 if successful, 0 if the file had already
been deleted or reused by someone else, -1 if I/O error. */
-int file_dotlock_delete_verified(struct dotlock **dotlock);
+int ATTR_NOWARN_UNUSED_RESULT
+file_dotlock_delete(struct dotlock **dotlock);
/* Use dotlock as the new content for file. This provides read safety without
locks, but it's not very good for large files. Returns fd for lock file.
#ifndef IOSTREAM_RAWLOG_H
#define IOSTREAM_RAWLOG_H
-int iostream_rawlog_create(const char *dir, struct istream **input,
- struct ostream **output);
+int ATTR_NOWARN_UNUSED_RESULT
+iostream_rawlog_create(const char *dir, struct istream **input,
+ struct ostream **output);
#endif
bstream->cur_line_len = 0;
}
- (void)i_stream_get_buffer_space(stream, (size+2)/3*4, &avail);
+ i_stream_get_buffer_space(stream, (size+2)/3*4, &avail);
buffer_avail = stream->buffer_size - stream->pos;
if ((size + 2) / 3 * 4 > buffer_avail) {
stream->istream.readable_fd = FALSE;
stream->istream.blocking = TRUE;
stream->istream.seekable = TRUE;
- (void)i_stream_create(stream, NULL, -1);
+ i_stream_create(stream, NULL, -1);
stream->statbuf.st_size = size;
return &stream->istream;
}
unsigned int return_nolf_line:1;
};
-struct istream *
+struct istream * ATTR_NOWARN_UNUSED_RESULT
i_stream_create(struct istream_private *stream, struct istream *parent, int fd)
ATTR_NULL(2);
void i_stream_compress(struct istream_private *stream);
void i_stream_grow_buffer(struct istream_private *stream, size_t bytes);
-bool i_stream_get_buffer_space(struct istream_private *stream,
- size_t wanted_size, size_t *size_r);
+bool ATTR_NOWARN_UNUSED_RESULT
+i_stream_get_buffer_space(struct istream_private *stream,
+ size_t wanted_size, size_t *size_r);
ssize_t i_stream_read_copy_from_parent(struct istream *istream);
void i_stream_default_seek(struct istream_private *stream,
uoff_t v_offset, bool mark);
struct istream_private *stream = _stream->real_stream;
size_t size2;
- (void)i_stream_get_buffer_space(stream, size, &size2);
+ i_stream_get_buffer_space(stream, size, &size2);
if (size > size2)
return FALSE;
void net_set_nonblock(int fd, bool nonblock);
/* Set TCP_CORK if supported, ie. don't send out partial frames.
Returns 0 if ok, -1 if failed. */
-int net_set_cork(int fd, bool cork);
+int net_set_cork(int fd, bool cork) ATTR_NOWARN_UNUSED_RESULT;
/* Set IP to contain INADDR_ANY for IPv4 or IPv6. The IPv6 any address may
include IPv4 depending on the system (Linux yes, BSD no). */
return;
}
- (void)client_unref(&client);
+ client_unref(&client);
}
int client_auth_begin(struct client *client, const char *mech_name,
void client_destroy_internal_failure(struct client *client);
void client_ref(struct client *client);
-bool client_unref(struct client **client);
+bool client_unref(struct client **client) ATTR_NOWARN_UNUSED_RESULT;
void client_cmd_starttls(struct client *client);
i_free(proxy);
client->login_proxy = NULL;
- (void)client_unref(&client);
+ client_unref(&client);
}
void login_proxy_free(struct login_proxy **_proxy)
if (proxy->io_plain != NULL)
io_remove(proxy->io_plain);
- (void)net_disconnect(proxy->fd_ssl);
- (void)net_disconnect(proxy->fd_plain);
+ net_disconnect(proxy->fd_ssl);
+ net_disconnect(proxy->fd_plain);
i_free(proxy);
}
if (corked)
- (void)net_set_cork(proxy->fd_ssl, FALSE);
+ net_set_cork(proxy->fd_ssl, FALSE);
ssl_proxy_unref(proxy);
}
if (proxy->sslout_size == 0)
ssl_set_io(proxy, SSL_REMOVE_OUTPUT);
else {
- (void)net_set_cork(proxy->fd_ssl, TRUE);
+ net_set_cork(proxy->fd_ssl, TRUE);
ssl_write(proxy);
- (void)net_set_cork(proxy->fd_ssl, FALSE);
+ net_set_cork(proxy->fd_ssl, FALSE);
}
}
(void)SSL_shutdown(proxy->ssl);
- (void)net_disconnect(proxy->fd_ssl);
- (void)net_disconnect(proxy->fd_plain);
+ net_disconnect(proxy->fd_ssl);
+ net_disconnect(proxy->fd_plain);
if (proxy->client != NULL)
- (void)client_unref(&proxy->client);
+ client_unref(&proxy->client);
ssl_proxy_unref(proxy);
}
if (lucene_index_get_last_uid(backend->index, last_uid_r) < 0)
return -1;
- (void)fts_index_set_last_uid(box, *last_uid_r);
+ fts_index_set_last_uid(box, *last_uid_r);
return 0;
}
(struct lucene_fts_backend_update_context *)_ctx;
if (ctx->last_uid != 0) {
- (void)fts_index_set_last_uid(ctx->box, ctx->last_uid);
+ fts_index_set_last_uid(ctx->box, ctx->last_uid);
ctx->last_uid = 0;
}
if (ctx->first_box_vname == NULL)
if (fts_backend_solr_get_last_uid_fallback(backend, box, last_uid_r) < 0)
return -1;
- (void)fts_index_set_last_uid(box, *last_uid_r);
+ fts_index_set_last_uid(box, *last_uid_r);
return 0;
}
struct mail_namespace *ns;
if (ctx->prev_uid != 0) {
- (void)fts_index_set_last_uid(ctx->cur_box, ctx->prev_uid);
+ fts_index_set_last_uid(ctx->cur_box, ctx->prev_uid);
ctx->prev_uid = 0;
}
if (get_last_uid_fallback(_backend, box, last_uid_r) < 0)
return -1;
- (void)fts_index_set_last_uid(box, *last_uid_r);
+ fts_index_set_last_uid(box, *last_uid_r);
return 0;
}
const char *box_guid;
if (ctx->prev_uid != 0) {
- (void)fts_index_set_last_uid(ctx->cur_box, ctx->prev_uid);
+ fts_index_set_last_uid(ctx->cur_box, ctx->prev_uid);
ctx->prev_uid = 0;
}
bool fts_index_get_header(struct mailbox *box, struct fts_index_header *hdr_r);
int fts_index_set_header(struct mailbox *box,
const struct fts_index_header *hdr);
-int fts_index_set_last_uid(struct mailbox *box, uint32_t last_uid);
+int ATTR_NOWARN_UNUSED_RESULT
+fts_index_set_last_uid(struct mailbox *box, uint32_t last_uid);
int fts_index_have_compatible_settings(struct mailbox_list *list,
uint32_t checksum);
size_t data_size;
bool ret;
- (void)mail_index_refresh(box->index);
+ mail_index_refresh(box->index);
view = mail_index_view_open(box->index);
mail_index_get_header_ext(view, fts_index_get_ext_id(box),
&data, &data_size);
if (rfc822_parse_mime_token(&parser, str) < 0)
return;
- (void)rfc2231_parse(&parser, &results);
+ rfc2231_parse(&parser, &results);
filename2 = NULL;
for (; *results != NULL; results += 2) {
if (strcasecmp(results[0], "filename") == 0) {
static bool fts_mailbox_build_continue(struct mail_search_context *ctx)
{
struct fts_search_context *fctx = FTS_CONTEXT(ctx);
- enum mail_error error;
int ret;
ret = fts_indexer_more(fctx->indexer_ctx);
if indexing failed for any other reason, just
fallback to searching the slow way. */
- (void)mailbox_get_last_error(fctx->box, &error);
- fctx->indexing_timed_out = error == MAIL_ERROR_INUSE;
+ fctx->indexing_timed_out =
+ mailbox_get_last_mail_error(fctx->box) == MAIL_ERROR_INUSE;
}
return TRUE;
}
command_unregister("DELETEACL");
command_unregister("LISTRIGHTS");
- (void)imap_client_created_hook_set(next_hook_client_created);
+ imap_client_created_hook_set(next_hook_client_created);
}
const char *imap_acl_plugin_dependencies[] = { "acl", NULL };
command_unregister("GETQUOTA");
command_unregister("SETQUOTA");
- (void)imap_client_created_hook_set(next_hook_client_created);
+ imap_client_created_hook_set(next_hook_client_created);
}
const char *imap_quota_plugin_dependencies[] = { "quota", NULL };
{
command_unregister("COMPRESS");
- (void)imap_client_created_hook_set(next_hook_client_created);
+ imap_client_created_hook_set(next_hook_client_created);
}
const char *imap_zlib_plugin_dependencies[] = { "zlib", NULL };
static int
pop3_mail_get_size(struct client *client, struct mail *mail, uoff_t *size_r)
{
- enum mail_error error;
int ret;
if (!client->set->pop3_fast_size_lookups)
if (ret == 0)
return 0;
- (void)mailbox_get_last_error(mail->box, &error);
- if (error != MAIL_ERROR_NOTPOSSIBLE)
+ if (mailbox_get_last_mail_error(mail->box) != MAIL_ERROR_NOTPOSSIBLE)
return -1;
/* virtual size not available with a fast lookup.
if (ret == 0)
return 0;
- (void)mailbox_get_last_error(mail->box, &error);
- if (error != MAIL_ERROR_NOTPOSSIBLE)
+ if (mailbox_get_last_mail_error(mail->box) != MAIL_ERROR_NOTPOSSIBLE)
return -1;
/* no way to quickly get the size. fallback to doing a slow virtual