Thanks to visit codestin.com
Credit goes to Github.com

Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compat/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ int git_open_cloexec(const char *name, int flags)

if (!o_cloexec && 0 <= fd && fd_cloexec) {
/* Opened w/o O_CLOEXEC? try with fcntl(2) to add it */
int flags = fcntl(fd, F_GETFD);
if (fcntl(fd, F_SETFD, flags | fd_cloexec))
int fd_flags = fcntl(fd, F_GETFD);
if (fd_flags < 0 || fcntl(fd, F_SETFD, fd_flags | fd_cloexec))
fd_cloexec = 0;
}
}
Expand Down
Loading