absolute_path(path), strerror(err));
}
-int unable_to_lock_error(const char *path, int err)
-{
- struct strbuf buf = STRBUF_INIT;
-
- unable_to_lock_message(path, err, &buf);
- error("%s", buf.buf);
- strbuf_release(&buf);
- return -1;
-}
-
NORETURN void unable_to_lock_die(const char *path, int err)
{
struct strbuf buf = STRBUF_INIT;
if (flags & LOCK_DIE_ON_ERROR)
exit(128);
+ close(orig_fd);
rollback_lock_file(lk);
errno = save_errno;
return -1;
+ } else {
+ close(orig_fd);
}
return fd;
}