summaryrefslogtreecommitdiff
path: root/packfile.c
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-12-26 10:42:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-12-26 18:09:35 (GMT)
commit280738c36ebd19076902796cb07950efc749d89b (patch)
tree30d28af132ed8a41c8af8d5650998a4838711c90 /packfile.c
parentd9589d4051537c387b70dc76e430c61b4c85a86d (diff)
downloadgit-280738c36ebd19076902796cb07950efc749d89b.zip
git-280738c36ebd19076902796cb07950efc749d89b.tar.gz
git-280738c36ebd19076902796cb07950efc749d89b.tar.bz2
packfile: remove redundant fcntl F_GETFD/F_SETFD
git_open sets close-on-exec since cd66ada06588f797 ("sha1_file: open window into packfiles with O_CLOEXEC"). There's no reason to keep using fcntl to set the close-on-exec flag, anymore. Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.c')
-rw-r--r--packfile.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/packfile.c b/packfile.c
index c0d83fd..518d9d5 100644
--- a/packfile.c
+++ b/packfile.c
@@ -489,7 +489,6 @@ static int open_packed_git_1(struct packed_git *p)
struct pack_header hdr;
unsigned char hash[GIT_MAX_RAWSZ];
unsigned char *idx_hash;
- long fd_flag;
ssize_t read_result;
const unsigned hashsz = the_hash_algo->rawsz;
@@ -533,16 +532,6 @@ static int open_packed_git_1(struct packed_git *p)
} else if (p->pack_size != st.st_size)
return error("packfile %s size changed", p->pack_name);
- /* We leave these file descriptors open with sliding mmap;
- * there is no point keeping them open across exec(), though.
- */
- fd_flag = fcntl(p->pack_fd, F_GETFD, 0);
- if (fd_flag < 0)
- return error("cannot determine file descriptor flags");
- fd_flag |= FD_CLOEXEC;
- if (fcntl(p->pack_fd, F_SETFD, fd_flag) == -1)
- return error("cannot set FD_CLOEXEC");
-
/* Verify we recognize this pack file format. */
read_result = read_in_full(p->pack_fd, &hdr, sizeof(hdr));
if (read_result < 0)