struct mailbox_log {
char *filepath, *filepath2;
int fd;
+ struct event *event;
time_t open_timestamp;
mode_t mode;
static void mailbox_log_close(struct mailbox_log *log);
-struct mailbox_log *mailbox_log_alloc(const char *path)
+struct mailbox_log *
+mailbox_log_alloc(struct event *parent_event, const char *path)
{
struct mailbox_log *log;
log = i_new(struct mailbox_log, 1);
+ log->event = event_create(parent_event);
log->filepath = i_strdup(path);
log->filepath2 = i_strconcat(path, ".2", NULL);
log->mode = 0644;
*_log = NULL;
mailbox_log_close(log);
+ event_unref(&log->event);
i_free(log->gid_origin);
i_free(log->filepath);
i_free(log->filepath2);
uint8_t timestamp[4];
};
-struct mailbox_log *mailbox_log_alloc(const char *path);
+struct mailbox_log *
+mailbox_log_alloc(struct event *parent_event, const char *path);
void mailbox_log_free(struct mailbox_log **log);
void mailbox_log_set_permissions(struct mailbox_log *log, mode_t mode,
return FALSE;
path = t_strconcat(path, "/"MAILBOX_LOG_FILE_NAME, NULL);
- list->changelog = mailbox_log_alloc(path);
+ list->changelog = mailbox_log_alloc(list->ns->user->event, path);
mailbox_list_get_root_permissions(list, &perm);
mailbox_log_set_permissions(list->changelog, perm.file_create_mode,