We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bae7e3f + 9fb9495 commit 3835124Copy full SHA for 3835124
sha1_file.c
@@ -1684,14 +1684,14 @@ int git_open_cloexec(const char *name, int flags)
1684
fd = open(name, flags | o_cloexec);
1685
}
1686
1687
-#if defined(F_GETFL) && defined(F_SETFL) && defined(FD_CLOEXEC)
+#if defined(F_GETFD) && defined(F_SETFD) && defined(FD_CLOEXEC)
1688
{
1689
static int fd_cloexec = FD_CLOEXEC;
1690
1691
if (!o_cloexec && 0 <= fd && fd_cloexec) {
1692
/* Opened w/o O_CLOEXEC? try with fcntl(2) to add it */
1693
- int flags = fcntl(fd, F_GETFL);
1694
- if (fcntl(fd, F_SETFL, flags | fd_cloexec))
+ int flags = fcntl(fd, F_GETFD);
+ if (fcntl(fd, F_SETFD, flags | fd_cloexec))
1695
fd_cloexec = 0;
1696
1697
0 commit comments