summaryrefslogtreecommitdiffabout
path: root/kmicromail/libetpan/generic/mhdriver_cached_message.c
Unidiff
Diffstat (limited to 'kmicromail/libetpan/generic/mhdriver_cached_message.c') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libetpan/generic/mhdriver_cached_message.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kmicromail/libetpan/generic/mhdriver_cached_message.c b/kmicromail/libetpan/generic/mhdriver_cached_message.c
index f716fb9..f69868d 100644
--- a/kmicromail/libetpan/generic/mhdriver_cached_message.c
+++ b/kmicromail/libetpan/generic/mhdriver_cached_message.c
@@ -158,50 +158,50 @@ static void mh_prefetch_free(struct generic_message_t * msg)
158 } 158 }
159} 159}
160 160
161static int mh_initialize(mailmessage * msg_info) 161static int mh_initialize(mailmessage * msg_info)
162{ 162{
163 struct generic_message_t * msg; 163 struct generic_message_t * msg;
164 int r; 164 int r;
165 char * uid; 165 char * uid;
166 char static_uid[PATH_MAX]; 166 char static_uid[PATH_MAX];
167 struct mailmh_msg_info * mh_msg_info; 167 struct mailmh_msg_info * mh_msg_info;
168 chashdatum key; 168 chashdatum key;
169 chashdatum data; 169 chashdatum data;
170 struct mailmh_folder * folder; 170 struct mailmh_folder * folder;
171 171
172 folder = get_mh_cur_folder(msg_info); 172 folder = get_mh_cur_folder(msg_info);
173 173
174 key.data = &msg_info->msg_index; 174 key.data = &msg_info->msg_index;
175 key.len = sizeof(msg_info->msg_index); 175 key.len = sizeof(msg_info->msg_index);
176 r = chash_get(folder->fl_msgs_hash, &key, &data); 176 r = chash_get(folder->fl_msgs_hash, &key, &data);
177 if (r < 0) 177 if (r < 0)
178 return MAIL_ERROR_INVAL; 178 return MAIL_ERROR_INVAL;
179 179
180 mh_msg_info = data.data; 180 mh_msg_info = data.data;
181 181
182 snprintf(static_uid, PATH_MAX, "%u-%lu-%u", msg_info->msg_index, 182 snprintf(static_uid, PATH_MAX, "%u-%lu-%lu", msg_info->msg_index,
183 mh_msg_info->msg_mtime, mh_msg_info->msg_size); 183 mh_msg_info->msg_mtime, (unsigned long) mh_msg_info->msg_size);
184 uid = strdup(static_uid); 184 uid = strdup(static_uid);
185 if (uid == NULL) 185 if (uid == NULL)
186 return MAIL_ERROR_MEMORY; 186 return MAIL_ERROR_MEMORY;
187 187
188 r = mailmessage_generic_initialize(msg_info); 188 r = mailmessage_generic_initialize(msg_info);
189 if (r != MAIL_NO_ERROR) { 189 if (r != MAIL_NO_ERROR) {
190 free(uid); 190 free(uid);
191 return r; 191 return r;
192 } 192 }
193 193
194 msg = msg_info->msg_data; 194 msg = msg_info->msg_data;
195 msg->msg_prefetch = mh_prefetch; 195 msg->msg_prefetch = mh_prefetch;
196 msg->msg_prefetch_free = mh_prefetch_free; 196 msg->msg_prefetch_free = mh_prefetch_free;
197 msg_info->msg_uid = uid; 197 msg_info->msg_uid = uid;
198 198
199 return MAIL_NO_ERROR; 199 return MAIL_NO_ERROR;
200} 200}
201 201
202static void mh_uninitialize(mailmessage * msg_info) 202static void mh_uninitialize(mailmessage * msg_info)
203{ 203{
204 mailmessage_generic_uninitialize(msg_info); 204 mailmessage_generic_uninitialize(msg_info);
205} 205}
206 206
207 207