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 <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2017-12-21 14:34:42 +01:00
parent 183cb6761d
commit 512e5d63ec

3
dir.c
View File

@@ -788,8 +788,9 @@ static int add_excludes(const char *fname, const char *base, int baselen,
fd = open(fname, O_RDONLY);
if (fd < 0)
warn_on_fopen_errors(fname);
if (S_ISLNK(st.st_mode) && fstat(fd, &st) < 0) {
else if (S_ISLNK(st.st_mode) && fstat(fd, &st) < 0) {
warn_on_fopen_errors(fname);
close(fd);
fd = -1;
}
}