]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
minor fix for error handling
authorTimo Sirainen <tss@iki.fi>
Sat, 19 Jun 2004 17:41:30 +0000 (20:41 +0300)
committerTimo Sirainen <tss@iki.fi>
Sat, 19 Jun 2004 17:41:30 +0000 (20:41 +0300)
--HG--
branch : HEAD

src/lib-index/mail-index.c

index acb30e168a067c859c3e622224ad7f9e3c97c4a4..584327129ed18ab8ad4c25a2a03b9b2b8bf7256b 100644 (file)
@@ -573,18 +573,17 @@ static int mail_index_create(struct mail_index *index,
                        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,