mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] [PATCH] nftw: Fix clobbering of errno
@ 2022-10-21 21:51 Ismael Luceno
  0 siblings, 0 replies; 2+ messages in thread
From: Ismael Luceno @ 2022-10-21 21:51 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.38.1


^ permalink raw reply	[flat|nested] 2+ messages in thread
* [musl] [PATCH] nftw: Fix clobbering of errno
@ 2022-01-23 15:45 Ismael Luceno
  0 siblings, 0 replies; 2+ messages 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] 2+ messages in thread

end of thread, other threads:[~2022-10-21 21:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21 21:51 [musl] [PATCH] nftw: Fix clobbering of errno Ismael Luceno
  -- strict thread matches above, loose matches on Subject: below --
2022-01-23 15:45 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).