do not check odb_mkstemp return value for errors
[gitweb.git] / pack-write.c
index c057513f12724254afa5a1550bfa9ada9deb943c..485080a31a512dea7fff58a925b5db45973fe3f1 100644 (file)
@@ -77,9 +77,9 @@ const char *write_idx_file(const char *index_name, struct pack_idx_entry **objec
                } else {
                        unlink(index_name);
                        fd = open(index_name, O_CREAT|O_EXCL|O_WRONLY, 0600);
+                       if (fd < 0)
+                               die_errno("unable to create '%s'", index_name);
                }
-               if (fd < 0)
-                       die_errno("unable to create '%s'", index_name);
                f = sha1fd(fd, index_name);
        }