Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Mar 2022 17:21:52 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 262038] fts(3): Check for readdir(3) errors
Message-ID:  <bug-262038-227-O2nXwjTDNv@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-262038-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-262038-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262038

--- Comment #12 from Mahmoud Abumandour <ma.mandourr@gmail.com> ---
(In reply to Mark Johnston from comment #11)

Thanks for the feedback. I will address it and resend the patch.

Regarding setting readdir_errno only if readdir errs, how is this achievable
without setting errno to 0? From the man page:

    The function returns NULL upon reaching the end of the directory or on
error. In the event of an error, errno may be set to any of the values
documented for the getdirentries(2) system call.

Which I think means that we must set errno to 0 to distinguish whether a NU=
LL
means error or "end of stream" indicator. Could you please elaborate more?
Maybe I can save errno and check that (ret =3D=3D NULL && saved_errno !=3D =
errno),
and if that's true then set readdir_errno?

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-262038-227-O2nXwjTDNv>