[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] fts: fix double call of close(p->fts_symfd)
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] fts: fix double call of close(p->fts_symfd) |
Date: |
Fri, 20 Feb 2015 15:14:34 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 20/02/15 10:44, Jaroslav Skarvada wrote:
> Hi,
>
> defect found by coverity, the attached patch is an attempt
> to fix it
We're discarding the errno from the close() in both cases,
so wouldn't this simplification be better?
thanks,
Pádraig.
diff --git a/lib/fts.c b/lib/fts.c
index a2c4e52..352ee05 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -1079,9 +1079,6 @@ cd_dot_dot:
}
} else if (p->fts_flags & FTS_SYMFOLLOW) {
if (FCHDIR(sp, p->fts_symfd)) {
- int saved_errno = errno;
- (void)close(p->fts_symfd);
- __set_errno (saved_errno);
p->fts_errno = errno;
SET(FTS_STOP);
}