summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--midx.c4
-rw-r--r--midx.h2
2 files changed, 1 insertions, 5 deletions
diff --git a/midx.c b/midx.c
index a520e26395..9a61d3b37d 100644
--- a/midx.c
+++ b/midx.c
@@ -72,9 +72,9 @@ struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local
FREE_AND_NULL(midx_name);
midx_map = xmmap(NULL, midx_size, PROT_READ, MAP_PRIVATE, fd, 0);
+ close(fd);
FLEX_ALLOC_STR(m, object_dir, object_dir);
- m->fd = fd;
m->data = midx_map;
m->data_len = midx_size;
m->local = local;
@@ -190,8 +190,6 @@ void close_midx(struct multi_pack_index *m)
return;
munmap((unsigned char *)m->data, m->data_len);
- close(m->fd);
- m->fd = -1;
for (i = 0; i < m->num_packs; i++) {
if (m->packs[i])
diff --git a/midx.h b/midx.h
index e6fa356b5c..b18cf53bc4 100644
--- a/midx.h
+++ b/midx.h
@@ -12,8 +12,6 @@ struct repository;
struct multi_pack_index {
struct multi_pack_index *next;
- int fd;
-
const unsigned char *data;
size_t data_len;