diff options
Diffstat (limited to 'pack-write.c')
-rw-r--r-- | pack-write.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pack-write.c b/pack-write.c index c057513f12..485080a31a 100644 --- a/pack-write.c +++ b/pack-write.c @@ -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); } |