Mercurial > dovecot > core-2.2
diff src/lib-index/mail-index.c @ 2170:fb785d235c43 HEAD
minor fix for error handling
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 19 Jun 2004 20:41:30 +0300 |
parents | db5807f350ca |
children | 1019b7694a11 |
line wrap: on
line diff
--- a/src/lib-index/mail-index.c Sat Jun 19 20:14:18 2004 +0300 +++ b/src/lib-index/mail-index.c Sat Jun 19 20:41:30 2004 +0300 @@ -573,18 +573,17 @@ mail_index_file_set_syscall_error(index, path, "unlink()"); } - return -1; - } - - /* make it visible to others */ - if (rename(path, index->filepath) < 0) { - mail_index_set_error(index, "rename(%s, %s) failed: %m", - path, index->filepath); - return -1; + } else { + /* make it visible to others */ + if (rename(path, index->filepath) < 0) { + mail_index_set_error(index, "rename(%s, %s) failed: %m", + path, index->filepath); + ret = -1; + } } mail_transaction_log_sync_unlock(index->log); - return 1; + return ret; } static void mail_index_header_init(struct mail_index *index,