comparison src/lib-index/mail-modifylog.c @ 259:cdf38b5cc2b7 HEAD

still wrong..
author Timo Sirainen <tss@iki.fi>
date Mon, 16 Sep 2002 12:52:58 +0300
parents 0a45c4744f51
children 51eea5cbb075
comparison
equal deleted inserted replaced
258:0a45c4744f51 259:cdf38b5cc2b7
281 if (file_wait_lock(fd, F_RDLCK) < 0) { 281 if (file_wait_lock(fd, F_RDLCK) < 0) {
282 modifylog_set_syscall_error(log, "file_wait_lock()"); 282 modifylog_set_syscall_error(log, "file_wait_lock()");
283 ret = -1; 283 ret = -1;
284 } 284 }
285 285
286 if (ret > 0 && (log->fd == -1 || modifylog_mark_full(log))) { 286 if (ret > 0 && (log->header == NULL ||
287 modifylog_mark_full(log))) {
287 mail_modifylog_close(log); 288 mail_modifylog_close(log);
288 289
289 log->fd = fd; 290 log->fd = fd;
290 log->filepath = i_strdup(path); 291 log->filepath = i_strdup(path);
291 return TRUE; 292 return TRUE;
383 log->filepath = i_strdup(path); 384 log->filepath = i_strdup(path);
384 } else { 385 } else {
385 (void)close(fd); 386 (void)close(fd);
386 } 387 }
387 388
388 return ret; 389 return ret > 0;
389 } 390 }
390 391
391 static int mail_modifylog_find_or_create(MailModifyLog *log) 392 static int mail_modifylog_find_or_create(MailModifyLog *log)
392 { 393 {
393 const char *path1, *path2; 394 const char *path1, *path2;