Skip to content

Commit 512e5d6

Browse files
committed
fixup! dir.c: regression fix for add_excludes with fscache
In my previous fixup, I forgot to close(fd)... D'oh. Squashed one bug, introduced another... Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 183cb67 commit 512e5d6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dir.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,8 +788,9 @@ static int add_excludes(const char *fname, const char *base, int baselen,
788788
fd = open(fname, O_RDONLY);
789789
if (fd < 0)
790790
warn_on_fopen_errors(fname);
791-
if (S_ISLNK(st.st_mode) && fstat(fd, &st) < 0) {
791+
else if (S_ISLNK(st.st_mode) && fstat(fd, &st) < 0) {
792792
warn_on_fopen_errors(fname);
793+
close(fd);
793794
fd = -1;
794795
}
795796
}

0 commit comments

Comments
 (0)