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);
                 }


Reply via email to