}
}
-static int zlib_mailbox_open_input(struct mailbox *box)
+static void zlib_mailbox_open_input(struct mailbox *box)
{
const struct compression_handler *handler;
struct istream *input;
handler = compression_lookup_handler_from_ext(box->name);
if (handler == NULL || handler->create_istream == NULL)
- return 0;
+ return;
if (mail_storage_is_mailbox_file(box->storage)) {
/* looks like a compressed single file mailbox. we should be
if (fd == -1) {
/* let the standard handler figure out what to do
with the failure */
- return 0;
+ return;
}
if (fstat(fd, &st) == 0 && S_ISDIR(st.st_mode)) {
i_close_fd(&fd);
- return 0;
+ return;
}
input = i_stream_create_fd_autoclose(&fd, MAX_INBUF_SIZE);
i_stream_set_name(input, box_path);
i_stream_unref(&input);
box->flags |= MAILBOX_FLAG_READONLY;
}
- return 0;
}
static int zlib_mailbox_open(struct mailbox *box)
if (box->input == NULL &&
(box->storage->class_flags &
- MAIL_STORAGE_CLASS_FLAG_OPEN_STREAMS) != 0) {
- if (zlib_mailbox_open_input(box) < 0)
- return -1;
- }
+ MAIL_STORAGE_CLASS_FLAG_OPEN_STREAMS) != 0)
+ zlib_mailbox_open_input(box);
return zbox->super.open(box);
}