mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] [PATCH] nftw: Fix clobbering of errno
@ 2022-01-23 15:45 Ismael Luceno
  0 siblings, 0 replies; only message in thread
From: Ismael Luceno @ 2022-01-23 15:45 UTC (permalink / raw)
  To: musl; +Cc: Rich Felker, Ismael Luceno

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
---
 src/misc/nftw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/misc/nftw.c b/src/misc/nftw.c
index 8dcff7fefd2a..5b233b2b8e77 100644
--- a/src/misc/nftw.c
+++ b/src/misc/nftw.c
@@ -93,8 +93,8 @@ static int do_nftw(char *path, int (*fn)(const char *, const struct stat *, int,
 				  || (de->d_name[1]=='.'
 				   && !de->d_name[2]))) continue;
 				if (strlen(de->d_name) >= PATH_MAX-l) {
-					errno = ENAMETOOLONG;
 					closedir(d);
+					errno = ENAMETOOLONG;
 					return -1;
 				}
 				path[j]='/';
-- 
2.33.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-23 15:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-23 15:45 [musl] [PATCH] nftw: Fix clobbering of errno Ismael Luceno

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).